<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>jQuery  API Browser </title>
</head>
<body>
<div id="content">
<ul id="docs">
<li id="link-add-expr">
<span class="fn"><a class="name" href="#link-add-expr">add</a>( <span class="arg-type tooltip" title="">String, DOMElement, Array&lt;DOMElement&gt;</span> <span class="arg-name tooltip" title="An expression whose matched elements are added for String, a string of HTML to create on the fly for DOMElement or one or more Elements to add if an Array.">expr</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Adds more elements, matched by the given expression, to the set of matched elements.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Finds all divs and makes a border.  Then adds all paragraphs to the jQuery object to set their backgrounds yellow.</p>
<pre>
<code class="javascript">

    $("div").css("border", "2px solid red")
            .add("p")
            .css("background", "yellow");
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;&lt;/div&gt;

  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;

  &lt;p&gt;Added this... (notice no border)&lt;/p&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Adds more elements, matched by the given expression, to the set of matched elements.</p>
<pre>
<code class="javascript">$("p").add("span").css("background", "yellow");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;Hello&lt;/p&gt;&lt;span&gt;Hello Again&lt;/span&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Adds more elements, created on the fly, to the set of matched elements.</p>
<pre>
<code class="javascript">$("p").clone().add("&amp;lt;span&gt;Again&amp;lt;/span&gt;").appendTo(document.body);</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;Hello&lt;/p&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Adds one or more Elements to the set of matched elements.</p>
<pre>
<code class="javascript">$("p").add(document.getElementById("a")).css("background", "yellow");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;Hello&lt;/p&gt;&lt;span id="a"&gt;Hello Again&lt;/span&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-addClass-class">
<span class="fn"><a class="name" href="#link-addClass-class">addClass</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="One or more CSS classes to add to the elements, these are separated by spaces.">class</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Adds the specified class(es) to each of the set of matched elements.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Adds the class 'selected' to the matched elements.</p>
<pre>
<code class="javascript">$("p:last").addClass("selected");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;Hello&lt;/p&gt;
  &lt;p&gt;and&lt;/p&gt;
  &lt;p&gt;Goodbye&lt;/p&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Adds the classes 'selected' and 'highlight' to the matched elements.</p>
<pre>
<code class="javascript">$("p:last").addClass("selected highlight");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;Hello&lt;/p&gt;
  &lt;p&gt;and&lt;/p&gt;
  &lt;p&gt;Goodbye&lt;/p&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-after-content">
<span class="fn"><a class="name" href="#link-after-content">after</a>( <span class="arg-type tooltip" title="">String, Element, jQuery</span> <span class="arg-name tooltip" title="Content to insert after each target.">content</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Insert content after each of the matched elements.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Inserts some HTML after all paragraphs.</p>
<pre>
<code class="javascript">$("p").after("&lt;b&gt;Hello&lt;/b&gt;");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;I would like to say: &lt;/p&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Inserts a DOM element after all paragraphs.</p>
<pre>
<code class="javascript">$("p").after( document.createTextNode("Hello") );</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;I would like to say: &lt;/p&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Inserts a jQuery object (similar to an Array of DOM Elements) after all paragraphs.</p>
<pre>
<code class="javascript">$("p").after( $("b") );</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;b&gt;Hello&lt;/b&gt;

  &lt;p&gt;I would like to say: &lt;/p&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-ajaxComplete-callback">
<span class="fn"><a class="name" href="#link-ajaxComplete-callback">ajaxComplete</a>( <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="The function to execute.

<pre>function (event, XMLHttpRequest, ajaxOptions) {
  this; // dom element listening
}
</pre>">callback</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Attach a function to be executed whenever an AJAX request completes. This is an &lt;a href='Ajax_Events'&gt;Ajax Event&lt;/a&gt;.<br>The XMLHttpRequest and settings used for that request are passed as arguments to the callback.</div>
<div class="example">
<h3>Example:</h3>
<p>Show a message when an AJAX request completes.</p>
<pre>
<code class="javascript"> $("#msg").ajaxComplete(function(request, settings){
   $(this).append("&lt;li&gt;Request Complete.&lt;/li&gt;");
 });</code>
</pre>
</div>
</div>
</li>
<li id="link-ajaxError-callback">
<span class="fn"><a class="name" href="#link-ajaxError-callback">ajaxError</a>( <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="The function to execute.

<pre>function (event, XMLHttpRequest, ajaxOptions, thrownError) {
  // thrownError only passed if an error was caught
  this; // dom element listening
}
</pre>">callback</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Attach a function to be executed whenever an AJAX request fails. This is an &lt;a href='Ajax_Events'&gt;Ajax Event&lt;/a&gt;.<br>The XMLHttpRequest and settings used for that request are passed as arguments to the callback. A third argument, an exception object, is passed if an exception occured while processing the request.</div>
<div class="example">
<h3>Example:</h3>
<p>Show a message when an AJAX request fails.</p>
<pre>
<code class="javascript"> $("#msg").ajaxError(function(request, settings){
   $(this).append("&lt;li&gt;Error requesting page " + settings.url + "&lt;/li&gt;");
 });</code>
</pre>
</div>
</div>
</li>
<li id="link-ajaxSend-callback">
<span class="fn"><a class="name" href="#link-ajaxSend-callback">ajaxSend</a>( <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="The function to execute.

<pre>function (event, XMLHttpRequest, ajaxOptions) {
  this; // dom element listening
}
</pre>">callback</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Attach a function to be executed before an AJAX request is sent. This is an &lt;a href='Ajax_Events'&gt;Ajax Event&lt;/a&gt;.<br>The XMLHttpRequest and settings used for that request are passed as arguments to the callback.</div>
<div class="example">
<h3>Example:</h3>
<p>Show a message before an AJAX request is sent.</p>
<pre>
<code class="javascript"> $("#msg").ajaxSend(function(evt, request, settings){
   $(this).append("&lt;li&gt;Starting request at " + settings.url + "&lt;/li&gt;");
 });</code>
</pre>
</div>
</div>
</li>
<li id="link-ajaxStart-callback">
<span class="fn"><a class="name" href="#link-ajaxStart-callback">ajaxStart</a>( <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="The function to execute.

<pre>function () {
  this; // dom element listening
}
</pre>">callback</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Attach a function to be executed whenever an AJAX request begins and there is none already active. This is an &lt;a href='Ajax_Events'&gt;Ajax Event&lt;/a&gt;.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Show a loading message whenever an AJAX request starts (and none is already active).</p>
<pre>
<code class="javascript"> $("#loading").ajaxStart(function(){
   $(this).show();
 });</code>
</pre>
</div>
</div>
</li>
<li id="link-ajaxStop-callback">
<span class="fn"><a class="name" href="#link-ajaxStop-callback">ajaxStop</a>( <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="The function to execute.
<pre>function () {
  this; // dom element listening
}
</pre>">callback</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Attach a function to be executed whenever all AJAX requests have ended. This is an &lt;a href='Ajax_Events'&gt;Ajax Event&lt;/a&gt;.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Hide a loading message after all the AJAX requests have stopped.</p>
<pre>
<code class="javascript"> $("#loading").ajaxStop(function(){
   $(this).hide();
 });</code>
</pre>
</div>
</div>
</li>
<li id="link-ajaxSuccess-callback">
<span class="fn"><a class="name" href="#link-ajaxSuccess-callback">ajaxSuccess</a>( <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="The function to execute.

<pre>function (event, XMLHttpRequest, ajaxOptions) {
  this; // dom element listening
}
</pre>">callback</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Attach a function to be executed whenever an AJAX request completes successfully. This is an &lt;a href='Ajax_Events'&gt;Ajax Event&lt;/a&gt;.<br>The event object, XMLHttpRequest, and settings used for that request are passed as arguments to the callback.</div>
<div class="example">
<h3>Example:</h3>
<p>Show a message when an AJAX request completes successfully.</p>
<pre>
<code class="javascript"> $("#msg").ajaxSuccess(function(evt, request, settings){
   $(this).append("&lt;li&gt;Successful Request!&lt;/li&gt;");
 });</code>
</pre>
</div>
</div>
</li>
<li id="link-all-">
<span class="fn"><a class="name" href="#link-all-">all</a>(  ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Matches all elements.<br>Most useful when combined with a context to search in.</div>
<div class="example">
<h3>Example:</h3>
<p>Finds every element (including head, body, etc).</p>
<pre>
<code class="javascript">$("*").css("border","3px solid red");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;DIV&lt;/div&gt;

  &lt;span&gt;SPAN&lt;/span&gt;
  &lt;p&gt;P &lt;button&gt;Button&lt;/button&gt;&lt;/p&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>A common way to find all elements is to set the 'context' to document.body so elements like head, script, etc are left out.</p>
<pre>
<code class="javascript">$("*", document.body).css("border","3px solid red");</code>
</pre>
</div>
</div>
</li>
<li id="link-andSelf-">
<span class="fn"><a class="name" href="#link-andSelf-">andSelf</a>(  ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Add the previous selection to the current selection.<br>Useful for traversing elements, and then adding something that was matched before the last traversion.</div>
<div class="example">
<h3>Example:</h3>
<p>Find all divs, and all the paragraphs inside of them, and give them both classnames.  Notice the div doesn't have the yellow background color since it didn't use andSelf().</p>
<pre>
<code class="javascript">
    $("div").find("p").andSelf().addClass("border");
    $("div").find("p").addClass("background");

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;
    &lt;p&gt;First Paragraph&lt;/p&gt;
    &lt;p&gt;Second Paragraph&lt;/p&gt;
  &lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-animate-paramsoptions">
<span class="fn"><a class="name" href="#link-animate-paramsoptions">animate</a>( <span class="arg-type tooltip" title="">Options</span> <span class="arg-name tooltip" title="A set of style attributes that you wish to animate, and to what end.">params</span>, <span class="arg-type tooltip" title="">Options </span> <span class="arg-name tooltip" title="A set of options with which to configure the animation.">options</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">A function for making your own, custom animations.<br>The key aspect of this function is the object of style properties that will be animated, and to what end. Each key within the object represents a style property that will also be animated (for example: "height", "top", or "opacity").<br>
<br>Note that properties should be specified using camel case eg. marginLeft instead of margin-left.<br>
<br>The value associated with the key represents to what end the property will be animated. If a number is provided as the value, then the style property will be transitioned from its current state to that new number. Otherwise if the string "hide", "show", or "toggle" is provided, a default animation will be constructed for that property. </div>
<h3>Options</h3>
<ul class="options">
<li>
<span>duration (<span class="arg-type tooltip" title="">String, Number</span>), default: "normal"</span>
<div>A string representing one of the three predefined speeds ("slow", "normal", or "fast") or the number of milliseconds to run the animation (e.g. 1000).</div>
</li>
<li>
<span>easing (<span class="arg-type tooltip" title="A string of characters.">String</span>), default: "swing"</span>
<div>The name of the easing effect that you want to use (Plugin Required). There are two built-in values, "linear" and "swing".</div>
</li>
<li>
<span>complete (<span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span>), default: </span>
<div>A function to be executed whenever the animation completes, executes once for each element animated against.</div>
</li>
<li>
<span>step (<span class="arg-type tooltip" title="">Callback</span>), default: </span>
<div></div>
</li>
<li>
<span>queue (<span class="arg-type tooltip" title="true or false.">Boolean</span>), default: true</span>
<div>Setting this to false will make the animation skip the queue and will begin running immediately. (Added in jQuery 1.2)</div>
</li>
</ul>
<div class="example">
<h3>Example:</h3>
<p>The first button shows how an unqueued animation works.  It expands the div out to 90% width '''while''' the font-size is increasing. Once the font-size change is complete, the border animation will begin.

The second button starts a traditional chained animation, where each animation will start once the previous animation on the element has completed.</p>
<pre>
<code class="javascript">

    $("#go1").click(function(){
      $("#block1").animate( { width:"90%" }, { queue:false, duration:3000 } )
         .animate( { fontSize:"24px" }, 1500 )
         .animate( { borderRightWidth:"15px" }, 1500);
    });

    $("#go2").click(function(){
      $("#block2").animate( { width:"90%"}, 1000 )
         .animate( { fontSize:"24px" } , 1000 )
         .animate( { borderLeftWidth:"15px" }, 1000);
    });

    $("#go3").click(function(){
      $("#go1").add("#go2").click();
    });

    $("#go4").click(function(){
      $("div").css({width:"", fontSize:"", borderWidth:""});
    });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;button id="go1"&gt;&amp;raquo; Animate Block1&lt;/button&gt;
  &lt;button id="go2"&gt;&amp;raquo; Animate Block2&lt;/button&gt;
  &lt;button id="go3"&gt;&amp;raquo; Animate Both&lt;/button&gt;

  &lt;button id="go4"&gt;&amp;raquo; Reset&lt;/button&gt;
  &lt;div id="block1"&gt;Block1&lt;/div&gt;
  &lt;div id="block2"&gt;Block2&lt;/div&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Animates all paragraphs to toggle both height and opacity, completing the animation within 600 milliseconds.</p>
<pre>
<code class="javascript">$("p").animate({
      "height": "toggle", "opacity": "toggle"

    }, { duration: "slow" });</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Animates all paragraph to a left style of 50 and opacity of 1 (opaque, visible), completing the animation within 500 milliseconds.  It also will do it ''outside'' the queue, meaning it will automatically start without waiting for its turn.</p>
<pre>
<code class="javascript">$("p").animate({
      left: "50px", opacity: 1
    }, { duration: 500, queue: false });</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>An example of using an 'easing' function to provide a different style of animation. This will only work if you have a plugin that provides this easing function.</p>
<pre>
<code class="javascript">$("p").animate({
      "opacity": "show"

    }, { "duration": "slow", "easing": "easein" });</code>
</pre>
</div>
</div>
</li>
<li id="link-animate-paramsdurationeasingcallback">
<span class="fn"><a class="name" href="#link-animate-paramsdurationeasingcallback">animate</a>( <span class="arg-type tooltip" title="">Options</span> <span class="arg-name tooltip" title="A set of style attributes that you wish to animate, and to what end.">params</span>, <span class="arg-type tooltip" title="">String, Number </span> <span class="arg-name tooltip" title="A string representing one of the three predefined speeds (&quot;slow&quot;, &quot;normal&quot;, or &quot;fast&quot;) or the number of milliseconds to run the animation (e.g. 1000).">duration</span>, <span class="arg-type tooltip" title="">String </span> <span class="arg-name tooltip" title="The name of the easing effect that you want to use (Plugin Required). There are two built-in values, &quot;linear&quot; and &quot;swing&quot;.">easing</span>, <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="A function to be executed whenever the animation completes, executes once for each element animated against.">callback</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">A function for making your own, custom animations.<br>The key aspect of this function is the object of style properties that will be animated, and to what end. Each key within the object represents a style property that will also be animated (for example: "height", "top", or "opacity").<br>
<br>Note that properties should be specified using camel case eg. marginLeft instead of margin-left.<br>
<br>The value associated with the key represents to what end the property will be animated. If a number is provided as the value, then the style property will be transitioned from its current state to that new number. Otherwise if the string "hide", "show", or "toggle" is provided, a default animation will be constructed for that property.  Only properties that take numeric values are supported (e.g. backgroundColor is not supported by animate()).<br>
<br>As of jQuery 1.2 you can now animate properties by em and % (where applicable). Additionally, in jQuery 1.2, you can now do relative animations - specifying a "''+=''" or "''-=''" in front of the property value to move the element positively, or negatively, relative to the current position.</div>
<div class="example">
<h3>Example:</h3>
<p>Click the button to animate the div with a number of different properties.</p>
<pre>
<code class="javascript">

    // Using multiple unit types within one animation.
    $("#go").click(function(){
      $("#block").animate({ 
        width: "70%",
        opacity: 0.4,
        marginLeft: "0.6in",
        fontSize: "3em", 
        borderWidth: "10px"
      }, 1500 );
    });
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;button id="go"&gt;&amp;raquo; Run&lt;/button&gt;

  &lt;div id="block"&gt;Hello!&lt;/div&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Shows a div animate with a relative move.  Click several times on the buttons to see the relative animations queued up.</p>
<pre>
<code class="javascript">
    $("#right").click(function(){
      $(".block").animate({"left": "+=50px"}, "slow");
    });

    $("#left").click(function(){
      $(".block").animate({"left": "-=50px"}, "slow");
    });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;button id="left"&gt;&amp;laquo;&lt;/button&gt; &lt;button id="right"&gt;&amp;raquo;&lt;/button&gt;
&lt;div class="block"&gt;&lt;/div&gt;
</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Animates all paragraphs to toggle both height and opacity, completing the animation within 600 milliseconds.</p>
<pre>
<code class="javascript">$("p").animate({
      "height": "toggle", "opacity": "toggle"

    }, "slow");</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Animates all paragraph to a left style of 50 and opacity of 1 (opaque, visible), completing the animation within 500 milliseconds.</p>
<pre>
<code class="javascript">$("p").animate({
      "left": "50", "opacity": 1
    }, 500);
</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>An example of using an 'easing' function to provide a different style of animation. This will only work if you have a plugin that provides this easing function.  Note, this code will do nothing unless the paragraph element is hidden.</p>
<pre>
<code class="javascript">$("p").animate({
      "opacity": "show"

    }, "slow", "easein");</code>
</pre>
</div>
</div>
</li>
<li id="link-animated-">
<span class="fn"><a class="name" href="#link-animated-">animated</a>(  ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Matches all elements that are currently being animated.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Change the color of any div that is animated.</p>
<pre>
<code class="javascript">

    $("#run").click(function(){
      $("div:animated").toggleClass("colored");
    });
    function animateIt() {
      $("#mover").slideToggle("slow", animateIt);
    }
    animateIt();
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;button id="run"&gt;Run&lt;/button&gt;

  &lt;div&gt;&lt;/div&gt;
  &lt;div id="mover"&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-append-content">
<span class="fn"><a class="name" href="#link-append-content">append</a>( <span class="arg-type tooltip" title="">String, Element, jQuery</span> <span class="arg-name tooltip" title="Content to append to the target.">content</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Append content to the inside of every matched element.<br>This operation is similar to doing an appendChild to all the specified elements, adding them into the document.</div>
<div class="example">
<h3>Example:</h3>
<p>Appends some HTML to all paragraphs.</p>
<pre>
<code class="javascript">$("p").append("&lt;b&gt;Hello&lt;/b&gt;");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;I would like to say: &lt;/p&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Appends an Element to all paragraphs.</p>
<pre>
<code class="javascript">$("p").append(document.createTextNode("Hello"));</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;I would like to say: &lt;/p&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Appends a jQuery object (similar to an Array of DOM Elements) to all paragraphs.</p>
<pre>
<code class="javascript">$("p").append( $("b") );</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;b&gt;Hello&lt;/b&gt;&lt;p&gt;I would like to say: &lt;/p&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-appendTo-content">
<span class="fn"><a class="name" href="#link-appendTo-content">appendTo</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="target to which the content will be appended.">content</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Append all of the matched elements to another, specified, set of elements.<br>This operation is, essentially, the reverse of doing a regular $(A).append(B), in that instead of appending B to A, you're appending A to B.</div>
<div class="example">
<h3>Example:</h3>
<p>Appends all spans to the element with the ID "foo"</p>
<pre>
<code class="javascript">$("span").appendTo("#foo"); // check append() examples</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;span&gt;I have nothing more to say... &lt;/span&gt;

  &lt;div id="foo"&gt;FOO! &lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-attr-name">
<span class="fn"><a class="name" href="#link-attr-name">attr</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="The name of the property to access.">name</span> ) returns <span class="type"><span class="tooltip" title="A simple Javascript object..">Object</span></span></span>
<div class="more">
<div class="desc">Access a property on the first matched element. This method makes it easy to retrieve a property value from the first matched element. If the element does not have an attribute with such a name, undefined is returned.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Finds the title attribute of the first &lt;em&gt; in the page.</p>
<pre>
<code class="javascript">

    var title = $("em").attr("title");
    $("div").text(title);
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;
    Once there was a &lt;em title="huge, gigantic"&gt;large&lt;/em&gt; dinosaur...
  &lt;/p&gt;

  The title of the emphasis is:&lt;div&gt;&lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-attr-properties">
<span class="fn"><a class="name" href="#link-attr-properties">attr</a>( <span class="arg-type tooltip" title="A Javascript object that contains key/value pairs in the form of properties and values.">Map</span> <span class="arg-name tooltip" title="Key/value pairs to set as object properties.">properties</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Set a key/value object as properties to all matched elements.<br>This serves as the best way to set a large number of properties on all matched elements. Note that you must use 'className' as key if you want to set the class-Attribute. Or use .addClass( class ) or .removeClass( class ).</div>
<div class="example">
<h3>Example:</h3>
<p>Set some attributes for all &lt;img&gt;s in the page.</p>
<pre>
<code class="javascript">
    $("img").attr({ 
          src: "/images/hat.gif",
          title: "jQuery",
          alt: "jQuery Logo"

        });
    $("div").text($("img").attr("alt"));
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;img /&gt;
  &lt;img /&gt;
  &lt;img /&gt;

  &lt;div&gt;&lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-attr-keyvalue">
<span class="fn"><a class="name" href="#link-attr-keyvalue">attr</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="The name of the property to set.">key</span>, <span class="arg-type tooltip" title="A simple Javascript object..">Object</span> <span class="arg-name tooltip" title="The value to set the property to.">value</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Set a single property to a value, on all matched elements.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Disables buttons greater than the 0th button.</p>
<pre>
<code class="javascript">$("button:gt(0)").attr("disabled","disabled");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;button&gt;0th Button&lt;/button&gt;

  &lt;button&gt;1st Button&lt;/button&gt;
  &lt;button&gt;2nd Button&lt;/button&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-attr-keyfn">
<span class="fn"><a class="name" href="#link-attr-keyfn">attr</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="The name of the property to set.">key</span>, <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="A function returning the value to set. Scope: Current element, argument: Index of current element
<pre>function callback(indexArray) {
  // indexArray[0] == position in the jQuery object
  this; // dom element
}
</pre>">fn</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Set a single property to a computed value, on all matched elements.<br>Instead of supplying a string value as described  &lt;a href='#keyvalue'&gt;above&lt;/a&gt;, a function is provided that computes the value.</div>
<div class="example">
<h3>Example:</h3>
<p>Sets id for divs based on the position in the page.</p>
<pre>
<code class="javascript">

    $("div").attr("id", function (arr) {
          return "div-id" + arr[0];
        })
        .each(function () {
          $("span", this).html("(ID = '&lt;b&gt;" + this.id + "&lt;/b&gt;')");
        });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;Zero-th &lt;span&gt;&lt;/span&gt;&lt;/div&gt;
  &lt;div&gt;First &lt;span&gt;&lt;/span&gt;&lt;/div&gt;
  &lt;div&gt;Second &lt;span&gt;&lt;/span&gt;&lt;/div&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Sets src attribute from title attribute on the image.</p>
<pre>
<code class="javascript">

    $("img").attr("src", function() { 
          return "/images/" + this.title; 
        });
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;img title="hat.gif"/&gt;
  &lt;img title="hat-old.gif"/&gt;

  &lt;img title="hat2-old.gif"/&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-attributeContains-attributevalue">
<span class="fn"><a class="name" href="#link-attributeContains-attributevalue">attributeContains</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="An attribute name.">attribute</span>, <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="An attribute value. Quotes are optional in most cases, but should be used to avoid conflicts when the value contains characters like &quot;]&quot;.">value</span> ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Matches elements that have the specified attribute and it contains a certain value.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Finds all inputs that with a name attribute that contains 'man' and sets the value with some text.</p>
<pre>
<code class="javascript">$("input[name*='man']").val("has man in it!");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;input name="man-news" /&gt;

  &lt;input name="milkman" /&gt;
  &lt;input name="letterman2" /&gt;
  &lt;input name="newmilk" /&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-attributeEndsWith-attributevalue">
<span class="fn"><a class="name" href="#link-attributeEndsWith-attributevalue">attributeEndsWith</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="An attribute name.">attribute</span>, <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="An attribute value. Quotes are optional in most cases, but should be used to avoid conflicts when the value contains characters like &quot;]&quot;.">value</span> ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Matches elements that have the specified attribute and it ends with a certain value.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Finds all inputs with an attribute name that ends with 'letter' and puts text in them.</p>
<pre>
<code class="javascript">$("input[name$='letter']").val("a letter");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;input name="newsletter" /&gt;

  &lt;input name="milkman" /&gt;
  &lt;input name="jobletter" /&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-attributeEquals-attributevalue">
<span class="fn"><a class="name" href="#link-attributeEquals-attributevalue">attributeEquals</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="An attribute name.">attribute</span>, <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="An attribute value. Quotes are optional in most cases, but should be used to avoid conflicts when the value contains characters like &quot;]&quot;.">value</span> ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Matches elements that have the specified attribute with a certain value.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Finds all inputs with name 'newsletter' and changes the text of the span next to it.</p>
<pre>
<code class="javascript">$("input[name='newsletter']").next().text(" is newsletter");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;

    &lt;input type="radio" name="newsletter" value="Hot Fuzz" /&gt;
    &lt;span&gt;name?&lt;/span&gt;

  &lt;/div&gt;
  &lt;div&gt;
    &lt;input type="radio" name="newsletter" value="Cold Fusion" /&gt;

    &lt;span&gt;name?&lt;/span&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;input type="radio" name="accept" value="Evil Plans" /&gt;

    &lt;span&gt;name?&lt;/span&gt;
  &lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-attributeHas-attribute">
<span class="fn"><a class="name" href="#link-attributeHas-attribute">attributeHas</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="An attribute name.">attribute</span> ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Matches elements that have the specified attribute.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Bind a single click that adds the div id to its text.</p>
<pre>
<code class="javascript">
    $("div[id]").one("click", function(){
      var idString = $(this).text() + " = " + $(this).attr("id");
      $(this).text(idString);
    });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;no id&lt;/div&gt;
  &lt;div id="hey"&gt;with id&lt;/div&gt;
  &lt;div id="there"&gt;has an id&lt;/div&gt;
  &lt;div&gt;nope&lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-attributeMultiple-selector1selector2selectorN">
<span class="fn"><a class="name" href="#link-attributeMultiple-selector1selector2selectorN">attributeMultiple</a>( <span class="arg-type tooltip" title="">Selector</span> <span class="arg-name tooltip" title="An attribute selector.">selector1</span>, <span class="arg-type tooltip" title="">Selector</span> <span class="arg-name tooltip" title="Another attribute selector, reducing the selection even more">selector2</span>, <span class="arg-type tooltip" title="">Selector</span> <span class="arg-name tooltip" title="As many more attribute selectors as necessary">selectorN</span> ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Matches elements that have the specified attribute and it contains a certain value.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Finds all inputs that have an id attribute and whose name attribute ends with man and sets the value.</p>
<pre>
<code class="javascript">$("input[id][name$='man']").val("only this one");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;input id="man-news" name="man-news" /&gt;

  &lt;input name="milkman" /&gt;
  &lt;input id="letterman" name="new-letterman" /&gt;
  &lt;input name="newmilk" /&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-attributeNotEqual-attributevalue">
<span class="fn"><a class="name" href="#link-attributeNotEqual-attributevalue">attributeNotEqual</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="An attribute name.">attribute</span>, <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="An attribute value. Quotes are optional in most cases, but should be used to avoid conflicts when the value contains characters like &quot;]&quot;.">value</span> ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Matches elements that don't have the specified attribute with a certain value.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Finds all inputs that don't have the name 'newsletter' and changes the text of the span next to it.</p>
<pre>
<code class="javascript">$("input[name!='newsletter']").next().text(" is not newsletter");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;

    &lt;input type="radio" name="newsletter" value="Hot Fuzz" /&gt;
    &lt;span&gt;name?&lt;/span&gt;

  &lt;/div&gt;
  &lt;div&gt;
    &lt;input type="radio" name="newsletter" value="Cold Fusion" /&gt;

    &lt;span&gt;name?&lt;/span&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;input type="radio" name="accept" value="Evil Plans" /&gt;

    &lt;span&gt;name?&lt;/span&gt;
  &lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-attributeStartsWith-attributevalue">
<span class="fn"><a class="name" href="#link-attributeStartsWith-attributevalue">attributeStartsWith</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="An attribute name.">attribute</span>, <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="An attribute value. Quotes are optional in most cases, but should be used to avoid conflicts when the value contains characters like &quot;]&quot;.">value</span> ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Matches elements that have the specified attribute and it starts with a certain value.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Finds all inputs with an attribute name that starts with 'news' and puts text in them.</p>
<pre>
<code class="javascript">$("input[name^='news']").val("news here!");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;input name="newsletter" /&gt;

  &lt;input name="milkman" /&gt;
  &lt;input name="newsboy" /&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-before-content">
<span class="fn"><a class="name" href="#link-before-content">before</a>( <span class="arg-type tooltip" title="">String, Element, jQuery</span> <span class="arg-name tooltip" title="Content to insert before each target.">content</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Insert content before each of the matched elements.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Inserts some HTML before all paragraphs.</p>
<pre>
<code class="javascript">$("p").before("&lt;b&gt;Hello&lt;/b&gt;");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt; is what I said...&lt;/p&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Inserts a DOM element before all paragraphs.</p>
<pre>
<code class="javascript">$("p").before( document.createTextNode("Hello") );</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt; is what I said...&lt;/p&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Inserts a jQuery object (similar to an Array of DOM Elements) before all paragraphs.</p>
<pre>
<code class="javascript">$("p").before( $("b") );</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt; is what I said...&lt;/p&gt;&lt;b&gt;Hello&lt;/b&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-bind-typedatafn">
<span class="fn"><a class="name" href="#link-bind-typedatafn">bind</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="An event type">type</span>, <span class="arg-type tooltip" title="A simple Javascript object..">Object</span> <span class="arg-name tooltip" title="Additional data passed to the event handler as event.data">data</span>, <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="A function to bind to the event on each of the set of matched elements

<pre>function callback(eventObject) {
  this; // dom element
}
</pre>">fn</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Binds a handler to a particular event (like click) for each matched element.  Can also bind custom events.<br>The event handler is passed an event object that you can use to prevent default behaviour. To stop both default action and event bubbling, your handler has to return false. Note that this will prevent handlers on parent elements from running but not other jQuery handlers on the same element.<br>
<br>In most cases, you can define your event handlers as anonymous functions (see first example). In cases where that is not possible, you can pass additional data as the second parameter (and the handler function as the third), see second example.</div>
<div class="example">
<h3>Example:</h3>
<p>Handle click and double-click for the paragraph.  Note: the coordinates are window relative so in this case relative to the demo iframe.</p>
<pre>
<code class="javascript">
    $("p").bind("click", function(e){
      var str = "( " + e.pageX + ", " + e.pageY + " )";
      $("span").text("Click happened! " + str);
    });
    $("p").bind("dblclick", function(){
      $("span").text("Double-click happened in " + this.tagName);
    });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;Click or double click here.&lt;/p&gt;
  &lt;span&gt;&lt;/span&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>To display each paragraph's text in an alert box whenever it is clicked:</p>
<pre>
<code class="javascript">$("p").bind("click", function(){
  alert( $(this).text() );
});</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>You can pass some extra data before the event handler:</p>
<pre>
<code class="javascript">function handler(event) {
  alert(event.data.foo);
}
$("p").bind("click", {foo: "bar"}, handler)</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>To cancel a default action and prevent it from bubbling up, return false:</p>
<pre>
<code class="javascript">$("form").bind("submit", function() { return false; })</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>To cancel only the default action by using the preventDefault method.</p>
<pre>
<code class="javascript">$("form").bind("submit", function(event){
  event.preventDefault();
});</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Stop only an event from bubbling by using the stopPropagation method.</p>
<pre>
<code class="javascript">$("form").bind("submit", function(event){
  event.stopPropagation();
});</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Can bind custom events too.</p>
<pre>
<code class="javascript">

    $("p").bind("myCustomEvent", function(e, myName, myValue){
      $(this).text(myName + ", hi there!");
      $("span").stop().css("opacity", 1)
               .text("myName = " + myName)
               .fadeIn(30).fadeOut(1000);
    });
    $("button").click(function () {
      $("p").trigger("myCustomEvent", [ "John" ]);
    });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;Has an attached custom event.&lt;/p&gt;
  &lt;button&gt;Trigger custom event&lt;/button&gt;
  &lt;span style="display:none;"&gt;&lt;/span&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-blur-">
<span class="fn"><a class="name" href="#link-blur-">blur</a>(  ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Triggers the blur event of each matched element.<br>This causes all of the functions that have been bound to that blur event to be executed, and calls the browser's default blur action on the matching element(s). This default action can be prevented by returning false from one of the functions bound to the blur event. The blur event usually fires when an element loses focus either via the pointing device or by tabbing navigation</div>
<div class="example">
<h3>Example:</h3>
<p>To triggers the blur event on all paragraphs:</p>
<pre>
<code class="javascript">$("p").blur();</code>
</pre>
</div>
</div>
</li>
<li id="link-blur-fn">
<span class="fn"><a class="name" href="#link-blur-fn">blur</a>( <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="A function to bind to the blur event on each of the matched elements.

<pre>function callback(eventObject) {
  this; // dom element
}
</pre>">fn</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Bind a function to the blur event of each matched element.<br>The blur event fires when an element loses focus either via the pointing device or by tabbing navigation.</div>
<div class="example">
<h3>Example:</h3>
<p>To pop up an alert saying "Hello World!" every time any paragraph's blur event triggers:</p>
<pre>
<code class="javascript">$("p").blur( function () { alert("Hello World!"); } );</code>
</pre>
</div>
</div>
</li>
<li id="link-button-">
<span class="fn"><a class="name" href="#link-button-">button</a>(  ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Matches all input elements of type button.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Finds all button inputs.</p>
<pre>
<code class="javascript">

    var input = $(":button").css({background:"yellow", border:"3px red solid"});
    $("div").text("For this type jQuery found " + input.length + ".")
            .css("color", "red");
    $("form").submit(function () { return false; }); // so it won't submit

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;form&gt;
    &lt;input type="button" value="Input Button"/&gt;
    &lt;input type="checkbox" /&gt;

    &lt;input type="file" /&gt;
    &lt;input type="hidden" /&gt;
    &lt;input type="image" /&gt;

    &lt;input type="password" /&gt;
    &lt;input type="radio" /&gt;
    &lt;input type="reset" /&gt;

    &lt;input type="submit" /&gt;
    &lt;input type="text" /&gt;
    &lt;select&gt;&lt;option&gt;Option&lt;option/&gt;&lt;/select&gt;

    &lt;textarea&gt;&lt;/textarea&gt;
    &lt;button&gt;Button&lt;/button&gt;
  &lt;/form&gt;
  &lt;div&gt;
  &lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-change-">
<span class="fn"><a class="name" href="#link-change-">change</a>(  ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Triggers the change event of each matched element.<br>This causes all of the functions that have been bound to that change event to be executed, and calls the browser's default change action on the matching element(s). This default action can be prevented by returning false from one of the functions bound to the change event. The change event usually fires when a control loses the input focus and its value has been modified since gaining focus.</div>
</div>
</li>
<li id="link-change-fn">
<span class="fn"><a class="name" href="#link-change-fn">change</a>( <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="A function to bind to the change event on each of the matched elements.

<pre>function callback(eventObject) {
  this; // dom element
}
</pre>">fn</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Binds a function to the change event of each matched element.<br>The change event fires when a control loses the input focus and its value has been modified since gaining focus.</div>
<div class="example">
<h3>Example:</h3>
<p>Attaches a change even to the select that gets the text for each selected option and writes them in the div.  It then triggers the event for the initial text draw.</p>
<pre>
<code class="javascript">
    $("select").change(function () {
          var str = "";
          $("select option:selected").each(function () {
                str += $(this).text() + " ";
              });
          $("div").text(str);
        })
        .change();
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;select name="sweets" multiple="multiple"&gt;
    &lt;option&gt;Chocolate&lt;/option&gt;
    &lt;option selected="selected"&gt;Candy&lt;/option&gt;

    &lt;option&gt;Taffy&lt;/option&gt;
    &lt;option selected="selected"&gt;Carmel&lt;/option&gt;
    &lt;option&gt;Fudge&lt;/option&gt;
    &lt;option&gt;Cookie&lt;/option&gt;

  &lt;/select&gt;
  &lt;div&gt;&lt;/div&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>To add a validity test to all text input elements:</p>
<pre>
<code class="javascript">$("input[@type='text']").change( function() {
  // check input for validity here
});</code>
</pre>
</div>
</div>
</li>
<li id="link-checkbox-">
<span class="fn"><a class="name" href="#link-checkbox-">checkbox</a>(  ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Matches all input elements of type checkbox.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Finds all checkbox inputs.</p>
<pre>
<code class="javascript">
    var input = $(":checkbox").css({background:"yellow", border:"3px red solid"});
    $("div").text("For this type jQuery found " + input.length + ".")
            .css("color", "red");
    $("form").submit(function () { return false; }); // so it won't submit

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;form&gt;
    &lt;input type="button" value="Input Button"/&gt;
    &lt;input type="checkbox" /&gt;

    &lt;input type="checkbox" /&gt;
    &lt;input type="file" /&gt;
    &lt;input type="hidden" /&gt;

    &lt;input type="image" /&gt;
    &lt;input type="password" /&gt;
    &lt;input type="radio" /&gt;

    &lt;input type="reset" /&gt;
    &lt;input type="submit" /&gt;
    &lt;input type="text" /&gt;

    &lt;select&gt;&lt;option&gt;Option&lt;option/&gt;&lt;/select&gt;
    &lt;textarea&gt;&lt;/textarea&gt;
    &lt;button&gt;Button&lt;/button&gt;
  &lt;/form&gt;

  &lt;div&gt;
  &lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-checked-">
<span class="fn"><a class="name" href="#link-checked-">checked</a>(  ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Matches all elements that are checked.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Finds all input elements that are checked.</p>
<pre>
<code class="javascript">

    function countChecked() {
      var n = $("input:checked").length;
      $("div").text(n + (n == 1 ? " is" : " are") + " checked!");
    }
    countChecked();
    $(":checkbox").click(countChecked);

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;form&gt;
    &lt;input type="checkbox" name="newsletter" checked="checked" value="Hourly" /&gt;

    &lt;input type="checkbox" name="newsletter" value="Daily" /&gt;
    &lt;input type="checkbox" name="newsletter" value="Weekly" /&gt;

    &lt;input type="checkbox" name="newsletter" checked="checked" value="Monthly" /&gt;
    &lt;input type="checkbox" name="newsletter" value="Yearly" /&gt;

  &lt;/form&gt;
  &lt;div&gt;&lt;/div&gt;</code>
</pre>
<h4>Result:</h4>
<pre>
<code class="html">[ &lt;input type="checkbox" name="newsletter" checked="checked" value="Daily" /&gt;,
  &lt;input type="checkbox" name="newsletter" checked="checked" value="Monthly" /&gt; ]</code>
</pre>
</div>
</div>
</li>
<li id="link-child-parentchild">
<span class="fn"><a class="name" href="#link-child-parentchild">child</a>( <span class="arg-type tooltip" title="">Selector</span> <span class="arg-name tooltip" title="Any valid selector.">parent</span>, <span class="arg-type tooltip" title="">Selector</span> <span class="arg-name tooltip" title="A selector to match elements that are children of the first selector.">child</span> ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Matches all child elements specified by "child" of elements specified by "parent".<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Finds all children of the element with id "main" which is yellow.</p>
<pre>
<code class="javascript">$("#main &gt; *").css("border", "3px double red");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;span id="main"&gt;
    &lt;div&gt;&lt;/div&gt;
    &lt;button&gt;Child&lt;/button&gt;
    &lt;div class="mini"&gt;&lt;/div&gt;

    &lt;div&gt;
      &lt;div class="mini"&gt;&lt;/div&gt;
      &lt;div class="mini"&gt;&lt;/div&gt;
    &lt;/div&gt;
    &lt;div&gt;&lt;button&gt;Grand&lt;/button&gt;&lt;/div&gt;

    &lt;div&gt;&lt;span&gt;A Span &lt;em&gt;in&lt;/em&gt; child&lt;/span&gt;&lt;/div&gt;
    &lt;span&gt;A Span in main&lt;/span&gt;

  &lt;/span&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-children-expr">
<span class="fn"><a class="name" href="#link-children-expr">children</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="An expression to filter the child Elements with.">expr</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Get a set of elements containing all of the unique immediate children of each of the matched set of elements.<br>This set can be filtered with an optional expression that will cause only elements matching the selector to be collected. Also note: while parents() will look at all ancestors, children() will only consider immediate child elements.</div>
<div class="example">
<h3>Example:</h3>
<p>Find all children of the clicked element.</p>
<pre>
<code class="javascript">

    $("#container").click(function (e) {
      $("*").removeClass("hilite");
      var $kids = $(e.target).children();
      var len = $kids.addClass("hilite").length;

      $("#results span:first").text(len);
      $("#results span:last").text(e.target.tagName);

      e.preventDefault();
      return false;
    });
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div id="container"&gt;

    &lt;div&gt;
      &lt;p&gt;This &lt;span&gt;is the &lt;em&gt;way&lt;/em&gt; we&lt;/span&gt; 
      write &lt;em&gt;the&lt;/em&gt; demo,&lt;/p&gt;

    &lt;/div&gt;
    &lt;div&gt;
      &lt;a href="#"&gt;&lt;b&gt;w&lt;/b&gt;rit&lt;b&gt;e&lt;/b&gt;&lt;/a&gt; the &lt;span&gt;demo,&lt;/span&gt; &lt;button&gt;write 
      the&lt;/button&gt; demo,
    &lt;/div&gt;

    &lt;div&gt;
      This &lt;span&gt;the way we &lt;em&gt;write&lt;/em&gt; the &lt;em&gt;demo&lt;/em&gt; so&lt;/span&gt;

      &lt;input type="text" value="early" /&gt; in
    &lt;/div&gt;
    &lt;p&gt;
      &lt;span&gt;t&lt;/span&gt;he &lt;span&gt;m&lt;/span&gt;orning.
      &lt;span id="results"&gt;Found &lt;span&gt;0&lt;/span&gt; children in &lt;span&gt;TAG&lt;/span&gt;.&lt;/span&gt;

    &lt;/p&gt;
  &lt;/div&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Find all children of each div.</p>
<pre>
<code class="javascript">$("div").children().css("border-bottom", "3px double red");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;Hello (this is a paragraph)&lt;/p&gt;

  &lt;div&gt;&lt;span&gt;Hello Again (this span is a child of the a div)&lt;/span&gt;&lt;/div&gt;
  &lt;p&gt;And &lt;span&gt;Again&lt;/span&gt; (in another paragraph)&lt;/p&gt;

  &lt;div&gt;And One Last &lt;span&gt;Time&lt;/span&gt; (most text directly in a div)&lt;/div&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Find all children with a class "selected" of each div.</p>
<pre>
<code class="javascript">$("div").children(".selected").css("color", "blue");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;
    &lt;span&gt;Hello&lt;/span&gt;
    &lt;p class="selected"&gt;Hello Again&lt;/p&gt;
    &lt;div class="selected"&gt;And Again&lt;/div&gt;

    &lt;p&gt;And One Last Time&lt;/p&gt;
  &lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-class-class">
<span class="fn"><a class="name" href="#link-class-class">class</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="A class to search for. An element can have multiple classes, one of them must match.">class</span> ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Matches all elements with the given class. <br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Finds the element with the class "myClass".</p>
<pre>
<code class="javascript">$(".myClass").css("border","3px solid red");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div class="notMe"&gt;div class="notMe"&lt;/div&gt;

  &lt;div class="myClass"&gt;div class="myClass"&lt;/div&gt;
  &lt;span class="myClass"&gt;span class="myClass"&lt;/span&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-click-">
<span class="fn"><a class="name" href="#link-click-">click</a>(  ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Triggers the click event of each matched element.<br>Causes all of the functions that have been bound to that click event to be executed.</div>
<div class="example">
<h3>Example:</h3>
<p>To trigger the click event on all of the paragraphs on the page:</p>
<pre>
<code class="javascript">$("p").click();</code>
</pre>
</div>
</div>
</li>
<li id="link-click-fn">
<span class="fn"><a class="name" href="#link-click-fn">click</a>( <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="A function to bind to the click event on each of the matched elements.

<pre>function callback(eventObject) {
  this; // dom element
}
</pre>">fn</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Binds a function to the click event of each matched element.<br>The click event fires when the pointing device button is clicked over an element. A click is defined as a mousedown and mouseup over the same screen location. The sequence of these events is:&lt;ul&gt;&lt;li&gt;mousedown&lt;/li&gt;&lt;li&gt;mouseup&lt;/li&gt;&lt;li&gt;click&lt;/li&gt;&lt;/ul&gt;</div>
<div class="example">
<h3>Example:</h3>
<p>To hide paragraphs on a page when they are clicked:</p>
<pre>
<code class="javascript">
    $("p").click(function () { 
      $(this).slideUp(); 
    });
    $("p").hover(function () {
      $(this).addClass("hilite");
    }, function () {
      $(this).removeClass("hilite");
    });
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;First Paragraph&lt;/p&gt;

  &lt;p&gt;Second Paragraph&lt;/p&gt;
  &lt;p&gt;Yet one more Paragraph&lt;/p&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-clone-">
<span class="fn"><a class="name" href="#link-clone-">clone</a>(  ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Clone matched DOM Elements and select the clones.<br>This is useful for moving copies of the elements to another location in the DOM.</div>
<div class="example">
<h3>Example:</h3>
<p>Clones all b elements (and selects the clones) and prepends them to all paragraphs.</p>
<pre>
<code class="javascript">$("b").clone().prependTo("p");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;b&gt;Hello&lt;/b&gt;&lt;p&gt;, how are you?&lt;/p&gt;</code>
</pre>
<h4>Result:</h4>
<pre>
<code class="html">&lt;b&gt;Hello&lt;/b&gt;&lt;p&gt;&lt;b&gt;Hello&lt;/b&gt;, how are you?&lt;/p&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-clone-true">
<span class="fn"><a class="name" href="#link-clone-true">clone</a>( <span class="arg-type tooltip" title="true or false.">Boolean</span> <span class="arg-name tooltip" title="Set to true to enable cloning of event handlers.">true</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Clone matched DOM Elements, and all their event handlers, and select the clones.<br>This is useful for moving copies of the elements, and their events, to another location in the DOM.</div>
<div class="example">
<h3>Example:</h3>
<p>Create a button that's able to clone itself - and have the clones themselves be clonable.</p>
<pre>
<code class="javascript">

    $("button").click(function(){
      $(this).clone(true).insertAfter(this);
    });
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;button&gt;Clone Me!&lt;/button&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-contains-text">
<span class="fn"><a class="name" href="#link-contains-text">contains</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="A string of text to look for. It's case sensitive.">text</span> ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Matches elements which contain the given text.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Finds all divs containing "John" and underlines them.</p>
<pre>
<code class="javascript">$("div:contains('John')").css("text-decoration", "underline");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;John Resig&lt;/div&gt;

  &lt;div&gt;George Martin&lt;/div&gt;
  &lt;div&gt;Malcom John Sinclair&lt;/div&gt;
  &lt;div&gt;J. Ohn</code>
</pre>
</div>
</div>
</li>
<li id="link-contents-">
<span class="fn"><a class="name" href="#link-contents-">contents</a>(  ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Find all the child nodes inside the matched elements (including text nodes), or the content document, if the element is an iframe.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Find all the text nodes inside a paragraph and wrap them with a bold tag.</p>
<pre>
<code class="javascript">$("p").contents().not("[nodeType=1]").wrap("&lt;b/&gt;");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;Hello &lt;a href="http://ejohn.org/"&gt;John&lt;/a&gt;, how are you doing?&lt;/p&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Append some new content into an empty iframe.</p>
<pre>
<code class="javascript">$("iframe").contents().find("body").append("I'm in an iframe!");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;iframe src="/index-blank.html" width="300" height="100"&gt;&lt;/iframe&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-css-name">
<span class="fn"><a class="name" href="#link-css-name">css</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="The name of the property to access.">name</span> ) returns <span class="type"><span class="tooltip" title="A string of characters.">String</span></span></span>
<div class="more">
<div class="desc">Return a style property on the first matched element.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>To access the background color of a clicked div.</p>
<pre>
<code class="javascript">
    $("div").click(function () {
      var color = $(this).css("background-color");
      $("#result").html("That div is &lt;span style='color:" +
                         color + ";'&gt;" + color + "&lt;/span&gt;.");
    });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;span id="result"&gt;&amp;nbsp;&lt;/span&gt;
  &lt;div style="background-color:blue;"&gt;&lt;/div&gt;
  &lt;div style="background-color:rgb(15,99,30);"&gt;&lt;/div&gt;

  &lt;div style="background-color:#123456;"&gt;&lt;/div&gt;
  &lt;div style="background-color:#f11;"&gt;&lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-css-properties">
<span class="fn"><a class="name" href="#link-css-properties">css</a>( <span class="arg-type tooltip" title="A Javascript object that contains key/value pairs in the form of properties and values.">Map</span> <span class="arg-name tooltip" title="Key/value pairs to set as style properties.">properties</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Set a key/value object as style properties to all matched elements.<br>This is the best way to set several style properties on all matched elements.</div>
<div class="example">
<h3>Example:</h3>
<p>To set the color of all paragraphs to red and background to blue:</p>
<pre>
<code class="javascript">
    $("p").hover(function () {
      $(this).css({ backgroundColor:"yellow", fontWeight:"bolder" });
    }, function () {
      var cssObj = {
        backgroundColor: "#ddd",
        fontWeight: "",
        color: "rgb(0,40,244)"

      }
      $(this).css(cssObj);
    });
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;
    Move the mouse over a paragraph.
  &lt;/p&gt;
  &lt;p&gt;
    Like this one or the one above.
  &lt;/p&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>If the property name includes a "-", put it between quotation marks:</p>
<pre>
<code class="javascript">

    $("p").hover(function () {
      $(this).css({ "background-color":"yellow", "font-weight":"bolder" });
    }, function () {
      var cssObj = {
        "background-color": "#ddd",
        "font-weight": "",
        color: "rgb(0,40,244)"

      }
      $(this).css(cssObj);
    });
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;
    Move the mouse over a paragraph.
  &lt;/p&gt;
  &lt;p&gt;
    Like this one or the one above.
  &lt;/p&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-css-namevalue">
<span class="fn"><a class="name" href="#link-css-namevalue">css</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="The name of the property to set.">name</span>, <span class="arg-type tooltip" title="">String or Number</span> <span class="arg-name tooltip" title="The value to set the property to.">value</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Set a single style property to a value on all matched elements.<br>If a number is provided, it is automatically converted into a pixel value.</div>
<div class="example">
<h3>Example:</h3>
<p>To change the color of any paragraph to red on mouseover event.</p>
<pre>
<code class="javascript">

    $("p").mouseover(function () {
      $(this).css("color","red");
    });
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;
    Just roll the mouse over me.
  &lt;/p&gt;

  &lt;p&gt;
    Or me to see a color change.
  &lt;/p&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>To highlight a clicked word in the paragraph.</p>
<pre>
<code class="javascript">
    var words = $("p:first").text().split(" ");
    var text = words.join("&lt;/span&gt; &lt;span&gt;");
    $("p:first").html("&lt;span&gt;" + text + "&lt;/span&gt;");
    $("span").click(function () {
      $(this).css("background-color","yellow");
    });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;
    Once upon a time there was a man
    who lived in a pizza parlor. This
    man just loved pizza and ate it all 
    the time.  He went on to be the
    happiest man in the world.  The end.
  &lt;/p&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-dblclick-">
<span class="fn"><a class="name" href="#link-dblclick-">dblclick</a>(  ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Triggers the dblclick event of each matched element.<br>This causes all of the functions that have been bound to that dblclick event to be executed, and calls the browser's default dblclick action on the matching element(s). This default action can be prevented by returning false from one of the functions bound to the dblclick event. The dblclick event usually fires when the pointing device button is double clicked over an element.</div>
</div>
</li>
<li id="link-dblclick-fn">
<span class="fn"><a class="name" href="#link-dblclick-fn">dblclick</a>( <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="The function to bind to the dblclick event on each of the matched elements.
<pre>function callback(eventObject) {
  this; // dom element
}

</pre>">fn</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Binds a function to the dblclick event of each matched element.<br>The dblclick event fires when the pointing device button is double clicked over an element</div>
<div class="example">
<h3>Example:</h3>
<p>To bind a "Hello World!" alert box the dblclick event on every paragraph on the page:</p>
<pre>
<code class="javascript">$("p").dblclick( function () { alert("Hello World!"); });</code>
</pre>
</div>
</div>
</li>
<li id="link-dequeue-">
<span class="fn"><a class="name" href="#link-dequeue-">dequeue</a>(  ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Removes a queued function from the front of the queue and executes it.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Use dequeue to end a custom queue function which allows the queue to keep going.</p>
<pre>
<code class="javascript">

    $("button").click(function () {
      $("div").animate({left:'+=200px'}, 2000);
      $("div").animate({top:'0px'}, 600);
      $("div").queue(function () {
        $(this).toggleClass("red");
        $(this).dequeue();
      });
      $("div").animate({left:'10px', top:'30px'}, 700);
    });
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;button&gt;Start&lt;/button&gt;

  &lt;div&gt;&lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-descendant-ancestordescendant">
<span class="fn"><a class="name" href="#link-descendant-ancestordescendant">descendant</a>( <span class="arg-type tooltip" title="">Selector</span> <span class="arg-name tooltip" title="Any valid selector.">ancestor</span>, <span class="arg-type tooltip" title="">Selector</span> <span class="arg-name tooltip" title="A selector to match elements that are descendants of the first selector.">descendant</span> ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Matches all descendant elements specified by "descendant" of elements specified by "ancestor".<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Finds all input descendants of forms.</p>
<pre>
<code class="javascript">$("form input").css("border", "2px dotted blue");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;form&gt;
    &lt;div&gt;Form is surrounded by the green outline&lt;/div&gt;
    &lt;label&gt;Child:&lt;/label&gt;
    &lt;input name="name" /&gt;

    &lt;fieldset&gt;
      &lt;label&gt;Grandchild:&lt;/label&gt;
      &lt;input name="newsletter" /&gt;
    &lt;/fieldset&gt;

  &lt;/form&gt;
  Sibling to form: &lt;input name="none" /&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-disabled-">
<span class="fn"><a class="name" href="#link-disabled-">disabled</a>(  ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Matches all elements that are disabled.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Finds all input elements that are disabled.</p>
<pre>
<code class="javascript">$("input:disabled").val("this is it");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;form&gt;

    &lt;input name="email" disabled="disabled" /&gt;
    &lt;input name="id" /&gt;
  &lt;/form&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-each-callback">
<span class="fn"><a class="name" href="#link-each-callback">each</a>( <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="The callback to execute for each matched element.

<pre>function callback(index, domElement) {
  this; // this == domElement
}
</pre>">callback</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Execute a function within the context of every matched element.<br>This means that every time the passed-in function is executed (which is once for every element matched) the 'this' keyword points to the specific DOM element.<br>
<br>Additionally, the function, when executed, is passed a single argument representing the position of the element in the matched set (integer, zero-index).<br>
<br>Returning 'false' from within the each function completely stops the loop through all of the elements (this is like using a 'break' with a normal loop). Returning 'true' from within the loop skips to the next iteration (this is like using a 'continue' with a normal loop). </div>
<div class="example">
<h3>Example:</h3>
<p>Iterates over three divs and sets their color property.</p>
<pre>
<code class="javascript">
    $(document.body).click(function () {
      $("div").each(function (i) {
        if (this.style.color != "blue") {
          this.style.color = "blue";
        } else {
          this.style.color = "";
        }
      });
    });
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;Click here&lt;/div&gt;

  &lt;div&gt;to iterate through&lt;/div&gt;
  &lt;div&gt;these divs.&lt;/div&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>If you want to have the jQuery object instead of the regular DOM element, use the $(this) function, for example:</p>
<pre>
<code class="javascript">
    $("span").click(function () {
      $("li").each(function(){
        $(this).toggleClass("example");
      });
    });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">To do list: &lt;span&gt;(click here to change)&lt;/span&gt;
  &lt;ul&gt;
    &lt;li&gt;Eat&lt;/li&gt;
    &lt;li&gt;Sleep&lt;/li&gt;

    &lt;li&gt;Be merry&lt;/li&gt;
  &lt;/ul&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>You can use 'return' to break out of each() loops early.</p>
<pre>
<code class="javascript">
    $("button").click(function () {
      $("div").each(function (index, domEle) {
        // domEle == this
        $(domEle).css("backgroundColor", "yellow"); 
        if ($(this).is("#stop")) {
          $("span").text("Stopped at div index #" + index);
          return false;
        }
      });
    });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;button&gt;Change colors&lt;/button&gt; 
  &lt;span&gt;&lt;/span&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;

  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div id="stop"&gt;Stop here&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;

  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-element-element">
<span class="fn"><a class="name" href="#link-element-element">element</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="An element to search for. Refers to the tagName of DOM nodes.">element</span> ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Matches all elements with the given name. <br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Finds every DIV element.</p>
<pre>
<code class="javascript">$("div").css("border","3px solid red");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;DIV1&lt;/div&gt;

  &lt;div&gt;DIV2&lt;/div&gt;
  &lt;span&gt;SPAN&lt;/span&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-empty-">
<span class="fn"><a class="name" href="#link-empty-">empty</a>(  ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Matches all elements that have no children (including text nodes).<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Finds all elements that are empty - they don't have child elements or text.</p>
<pre>
<code class="javascript">$("td:empty").text("Was empty!").css('background', 'rgb(255,220,200)');</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;table border="1"&gt;
    &lt;tr&gt;&lt;td&gt;TD #0&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;TD #2&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;

    &lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;TD#5&lt;/td&gt;&lt;/tr&gt;
  &lt;/table&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-empty-">
<span class="fn"><a class="name" href="#link-empty-">empty</a>(  ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Remove all child nodes from the set of matched elements.<br>Note that this function starting with 1.2.2 will also remove all event handlers and internally cached data.</div>
<div class="example">
<h3>Example:</h3>
<p>Removes all child nodes (including text nodes) from all paragraphs</p>
<pre>
<code class="javascript">
    $("button").click(function () {
      $("p").empty();
    });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;
    Hello, &lt;span&gt;Person&lt;/span&gt; &lt;a href="javascript:;"&gt;and person&lt;/a&gt;
  &lt;/p&gt;

  &lt;button&gt;Call empty() on above paragraph&lt;/button&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-enabled-">
<span class="fn"><a class="name" href="#link-enabled-">enabled</a>(  ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Matches all elements that are enabled.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Finds all input elements that are enabled.</p>
<pre>
<code class="javascript">$("input:enabled").val("this is it");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;form&gt;
    &lt;input name="email" disabled="disabled" /&gt;

    &lt;input name="id" /&gt;
  &lt;/form&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-end-">
<span class="fn"><a class="name" href="#link-end-">end</a>(  ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Revert the most recent 'destructive' operation, changing the set of matched elements to its previous state (right before the destructive operation).<br>If there was no destructive operation before, an empty set is returned.<br>
<br>A 'destructive' operation is any operation that changes the set of matched jQuery elements, which means any Traversing function that returns a jQuery object - including &lt;a href='Traversing/add'&gt;add&lt;/a&gt;, &lt;a href='Traversing/andSelf'&gt;andSelf&lt;/a&gt;, &lt;a href='Traversing/children'&gt;children&lt;/a&gt;, &lt;a href='Traversing/filter'&gt;filter&lt;/a&gt;, &lt;a href='Traversing/find'&gt;find&lt;/a&gt;, &lt;a href='Traversing/map'&gt;map&lt;/a&gt;, &lt;a href='Traversing/next'&gt;next&lt;/a&gt;, &lt;a href='Traversing/nextAll'&gt;nextAll&lt;/a&gt;, &lt;a href='Traversing/not'&gt;not&lt;/a&gt;, &lt;a href='Traversing/parent'&gt;parent&lt;/a&gt;, &lt;a href='Traversing/parents'&gt;parents&lt;/a&gt;, &lt;a href='Traversing/prev'&gt;prev&lt;/a&gt;, &lt;a href='Traversing/prevAll'&gt;prevAll&lt;/a&gt;, &lt;a href='Traversing/siblings'&gt;siblings&lt;/a&gt; and &lt;a href='Traversing/slice'&gt;slice&lt;/a&gt; - plus the &lt;a href='Manipulation/clone'&gt;clone&lt;/a&gt; function (from Manipulation). </div>
<div class="example">
<h3>Example:</h3>
<p>Selects all paragraphs, finds span elements inside these, and reverts the selection back to the paragraphs.</p>
<pre>
<code class="javascript">

    jQuery.fn.showTags = function (n) {
      var tags = this.map(function () { 
                              return this.tagName; 
                            })
                        .get().join(", ");
      $("b:eq(" + n + ")").text(tags);
      return this;
    };

    $("p").showTags(0)
          .find("span")
          .showTags(1)
          .css("background", "yellow")
          .end()
          .showTags(2)
          .css("font-style", "italic");

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;
    Hi there &lt;span&gt;how&lt;/span&gt; are you &lt;span&gt;doing&lt;/span&gt;?
  &lt;/p&gt;

  &lt;p&gt;
    This &lt;span&gt;span&lt;/span&gt; is one of 
    several &lt;span&gt;spans&lt;/span&gt; in this
    &lt;span&gt;sentence&lt;/span&gt;.
  &lt;/p&gt;

  &lt;div&gt;
    Tags in jQuery object initially: &lt;b&gt;&lt;/b&gt;
  &lt;/div&gt;
  &lt;div&gt;
    Tags in jQuery object after find: &lt;b&gt;&lt;/b&gt;

  &lt;/div&gt;
  &lt;div&gt;
    Tags in jQuery object after end: &lt;b&gt;&lt;/b&gt;
  &lt;/div&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Selects all paragraphs, finds span elements inside these, and reverts the selection back to the paragraphs.</p>
<pre>
<code class="javascript">$("p").find("span").end().css("border", "2px red solid");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;&lt;span&gt;Hello&lt;/span&gt;, how are you?&lt;/p&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-eq-position">
<span class="fn"><a class="name" href="#link-eq-position">eq</a>( <span class="arg-type tooltip" title="A valid numeric.">Number</span> <span class="arg-name tooltip" title="The index of the element to select.">position</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Reduce the set of matched elements to a single element.<br>The position of the element in the set of matched elements starts at 0 and goes to length - 1.</div>
<div class="example">
<h3>Example:</h3>
<p>Reduces the selection to the second selected element.</p>
<pre>
<code class="javascript">$("p").eq(1)</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;This is just a test.&lt;/p&gt;&lt;p&gt;So is this&lt;/p&gt;</code>
</pre>
<h4>Result:</h4>
<pre>
<code class="html">[ &lt;p&gt;So is this&lt;/p&gt; ]</code>
</pre>
</div>
</div>
</li>
<li id="link-eq-index">
<span class="fn"><a class="name" href="#link-eq-index">eq</a>( <span class="arg-type tooltip" title="A valid numeric.">Number</span> <span class="arg-name tooltip" title="Zero-based index of the element to match.">index</span> ) returns <span class="type"><span class="tooltip" title="The Javascript object representation of a DOM Element.">Element</span></span></span>
<div class="more">
<div class="desc">Matches a single element by its index.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Finds the third td. (annoying blink isn't it)</p>
<pre>
<code class="javascript">$("td:eq(2)").css("text-decoration", "blink");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;table border="1"&gt;

    &lt;tr&gt;&lt;td&gt;TD #0&lt;/td&gt;&lt;td&gt;TD #1&lt;/td&gt;&lt;td&gt;TD #2&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;TD #3&lt;/td&gt;&lt;td&gt;TD #4&lt;/td&gt;&lt;td&gt;TD #5&lt;/td&gt;&lt;/tr&gt;

    &lt;tr&gt;&lt;td&gt;TD #6&lt;/td&gt;&lt;td&gt;TD #7&lt;/td&gt;&lt;td&gt;TD #8&lt;/td&gt;&lt;/tr&gt;
  &lt;/table&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-eq-index">
<span class="fn"><a class="name" href="#link-eq-index">eq</a>( <span class="arg-type tooltip" title="">Integer</span> <span class="arg-name tooltip" title="The index of the element in the jQuery object.">index</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Reduce the set of matched elements to a single element. <br>The position of the element in the set of matched elements starts at 0 and goes to length - 1.</div>
<div class="example">
<h3>Example:</h3>
<p>Turn the div with index 2 red by adding an appropriate class.</p>
<pre>
<code class="javascript">

    $("div").eq(2).addClass("red");
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;

  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-error-">
<span class="fn"><a class="name" href="#link-error-">error</a>(  ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Triggers the error event of each matched element.<br>This causes all of the functions that have been bound to that error event to be executed, and calls the browser's default error action on the matching element(s). This default action can be prevented by returning false from one of the functions bound to the error event. The error event usually fires when an element loses focus either via the pointing device or by tabbing navigation.</div>
</div>
</li>
<li id="link-error-fn">
<span class="fn"><a class="name" href="#link-error-fn">error</a>( <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="An event handler function to bind to the error event.

<pre>function callback(eventObject) {
  this; // dom element
}
</pre>">fn</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Binds a function to the error event of each matched element.<br>&lt;p&gt;There is no public standard for the error event. In most browsers, the window object's error event is triggered when a JavaScript error occurs on the page. An image object's error event is triggered when it is set an invalid src attribute - either a non-existent file, or one with corrupt image data.&lt;/p&gt;&lt;p&gt;If the event is thrown by the window object, the event handler will be passed three parameters: &lt;ol&gt;&lt;li&gt;A message describing the event ("varName is not defined", "missing operator in expression", etc.),&lt;/li&gt;&lt;li&gt;the full URL of the document containing the error, and&lt;/li&gt;&lt;li&gt;the line number on which the error occured.&lt;/li&gt;&lt;/ol&gt;&lt;/p&gt;<br>
<br>&lt;p&gt;If the event handler returns true, it signifies that the event was handled, and the browser raises no errors.&lt;/p&gt;&lt;p&gt;For more information, see: &lt;ul&gt;&lt;li&gt;[http://msdn2.microsoft.com/en-us/library/ms536930.aspx msdn - onerror Event]&lt;/li&gt;&lt;li&gt;[http://developer.mozilla.org/en/docs/DOM:window.onerror Gecko DOM Reference - onerror Event]&lt;/li&gt;&lt;li&gt;[http://developer.mozilla.org/en/docs/DOM:event Gecko DOM Reference - Event object]&lt;/li&gt;&lt;li&gt;[http://en.wikipedia.org/wiki/DOM_Events Wikipedia: DOM Events]&lt;/ul&gt;&lt;/p&gt;</div>
<div class="example">
<h3>Example:</h3>
<p>To keep a server-side log of JavaScript errors, you might want to:</p>
<pre>
<code class="javascript">$(window).error(function(msg, url, line){
  jQuery.post("js_error_log.php", { msg: msg, url: url, line: line });
});</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>To hide JavaScript errors from the user, you can try:</p>
<pre>
<code class="javascript">$(window).error(function(){
  return true;
});</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>To hide the "broken image" icons for your IE users, you can try:</p>
<pre>
<code class="javascript">$("img").error(function(){
  $(this).hide();
});</code>
</pre>
</div>
</div>
</li>
<li id="link-even-">
<span class="fn"><a class="name" href="#link-even-">even</a>(  ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Matches even elements, zero-indexed.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Finds even table rows, matching the first, third and so on (index 0, 2, 4 etc.).</p>
<pre>
<code class="javascript">$("tr:even").css("background-color", "#bbbbff");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;table border="1"&gt;
    &lt;tr&gt;&lt;td&gt;Row with Index #0&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;Row with Index #1&lt;/td&gt;&lt;/tr&gt;

    &lt;tr&gt;&lt;td&gt;Row with Index #2&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;Row with Index #3&lt;/td&gt;&lt;/tr&gt;
  &lt;/table&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-fadeIn-speedcallback">
<span class="fn"><a class="name" href="#link-fadeIn-speedcallback">fadeIn</a>( <span class="arg-type tooltip" title="">String, Number </span> <span class="arg-name tooltip" title="A string representing one of the three predefined speeds (&quot;slow&quot;, &quot;normal&quot;, or &quot;fast&quot;) or the number of milliseconds to run the animation (e.g. 1000).">speed</span>, <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="A function to be executed whenever the animation completes, executes once for each element animated against.

<pre>function callback() {
  this; // dom element
}
</pre>">callback</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Fade in all matched elements by adjusting their opacity and firing an optional callback after completion.<br>Only the opacity is adjusted for this animation, meaning that all of the matched elements should already have some form of height and width associated with them.</div>
<div class="example">
<h3>Example:</h3>
<p>Animates hidden divs to fade in one by one, completing each animation within 600 milliseconds.</p>
<pre>
<code class="javascript">
    $(document.body).click(function () {
      $("div:hidden:first").fadeIn("slow");
    });
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;span&gt;Click here...&lt;/span&gt;

  &lt;div id="one"&gt;&lt;/div&gt;
  &lt;div id="two"&gt;&lt;/div&gt;
  &lt;div id="three"&gt;&lt;/div&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Fades a red block in over the text. Once the animation is done, it quickly fades in more text on top.</p>
<pre>
<code class="javascript">
    $("a").click(function () {
      $("div").fadeIn(3000, function () {
        $("span").fadeIn(100);
      });
      return false;
    }); 

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;
    Let it be known that the party of the first part
    and the party of the second part are henceforth
    and hereto directed to assess the allegations
    for factual correctness... (&lt;a href="#"&gt;click!&lt;/a&gt;)
    &lt;div&gt;&lt;span&gt;CENSORED!&lt;/span&gt;&lt;/div&gt;

  &lt;/p&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-fadeOut-speedcallback">
<span class="fn"><a class="name" href="#link-fadeOut-speedcallback">fadeOut</a>( <span class="arg-type tooltip" title="">String, Number </span> <span class="arg-name tooltip" title="A string representing one of the three predefined speeds (&quot;slow&quot;, &quot;normal&quot;, or &quot;fast&quot;) or the number of milliseconds to run the animation (e.g. 1000).">speed</span>, <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="A function to be executed whenever the animation completes, executes once for each element animated against.
<pre>function callback() {
  this; // dom element
}
</pre>">callback</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Fade out all matched elements by adjusting their opacity and firing an optional callback after completion.<br>Only the opacity is adjusted for this animation, meaning that all of the matched elements should already have some form of height and width associated with them.</div>
<div class="example">
<h3>Example:</h3>
<p>Animates all paragraphs to fade out, completing the animation within 600 milliseconds.</p>
<pre>
<code class="javascript">

    $("p").click(function () {
      $("p").fadeOut("slow");
    });
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;
    If you click on this paragraph
    you'll see it just fade away.
  &lt;/p&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Fades out spans in one section that you click on.</p>
<pre>
<code class="javascript">

    $("span").click(function () {
      $(this).fadeOut(1000, function () {
        $("div").text("'" + $(this).text() + "' has faded!");
        $(this).remove();
      });
    });
    $("span").hover(function () {
      $(this).addClass("hilite");
    }, function () {
      $(this).removeClass("hilite");
    });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;h3&gt;Find the modifiers - &lt;div&gt;&lt;/div&gt;&lt;/h3&gt;
  &lt;p&gt;
    If you &lt;span&gt;really&lt;/span&gt; want to go outside
    &lt;span&gt;in the cold&lt;/span&gt; then make sure to wear
    your &lt;span&gt;warm&lt;/span&gt; jacket given to you by
    your &lt;span&gt;favorite&lt;/span&gt; teacher.
  &lt;/p&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-fadeTo-speedopacitycallback">
<span class="fn"><a class="name" href="#link-fadeTo-speedopacitycallback">fadeTo</a>( <span class="arg-type tooltip" title="">String, Number </span> <span class="arg-name tooltip" title="A string representing one of the three predefined speeds (&quot;slow&quot;, &quot;normal&quot;, or &quot;fast&quot;) or the number of milliseconds to run the animation (e.g. 1000).">speed</span>, <span class="arg-type tooltip" title="">Number </span> <span class="arg-name tooltip" title="The opacity to fade to (a number from 0 to 1).">opacity</span>, <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="A function to be executed whenever the animation completes, executed once for each element animated against.

<pre>function callback() {
  this; // dom element
}
</pre>">callback</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Fade the opacity of all matched elements to a specified opacity and firing an optional callback after completion.<br>Only the opacity is adjusted for this animation, meaning that all of the matched elements should already have some form of height and width associated with them.</div>
<div class="example">
<h3>Example:</h3>
<p>Animates first paragraph to fade to an opacity of 0.33 (33%, about one third visible), completing the animation within 600 milliseconds.</p>
<pre>
<code class="javascript">
    $("p:first").click(function () {
      $(this).fadeTo("slow", 0.33);
    });
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;
    Click this paragraph to see it fade.
  &lt;/p&gt;

  &lt;p&gt;
    Compare to this one that won't fade.
  &lt;/p&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Fade div to a random opacity on each click, completing the animation within 200 milliseconds.</p>
<pre>
<code class="javascript">
    $("div").click(function () {
      $(this).fadeTo("fast", Math.random());
    });
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;And this is the library that John built...&lt;/p&gt;

  &lt;div id="one"&gt;&lt;/div&gt;
  &lt;div id="two"&gt;&lt;/div&gt;
  &lt;div id="three"&gt;&lt;/div&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Find the right answer!  The fade will take 250 milliseconds and change various styles when it completes.</p>
<pre>
<code class="javascript">
    var getPos = function (n) {
      return (Math.floor(n) * 90) + "px";
    };
    $("p").each(function (n) {
      var r = Math.floor(Math.random() * 3);
      var tmp = $(this).text();
      $(this).text($("p:eq(" + r + ")").text());
      $("p:eq(" + r + ")").text(tmp);
      $(this).css("left", getPos(n));
    });
    $("div").each(function (n) {
                  $(this).css("left", getPos(n));
                })
            .css("cursor", "pointer")
            .click(function () {
                  $(this).fadeTo(250, 0.25, function () {
                        $(this).css("cursor", "")
                               .prev().css({"font-weight": "bolder",
                                            "font-style": "italic"});
                      });
                });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;Wrong&lt;/p&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;p&gt;Wrong&lt;/p&gt;
  &lt;div&gt;&lt;/div&gt;

  &lt;p&gt;Right!&lt;/p&gt;
  &lt;div&gt;&lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-file-">
<span class="fn"><a class="name" href="#link-file-">file</a>(  ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Matches all input elements of type file.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Finds all file inputs.</p>
<pre>
<code class="javascript">

    var input = $(":file").css({background:"yellow", border:"3px red solid"});
    $("div").text("For this type jQuery found " + input.length + ".")
            .css("color", "red");
    $("form").submit(function () { return false; }); // so it won't submit

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;form&gt;
    &lt;input type="button" value="Input Button"/&gt;
    &lt;input type="checkbox" /&gt;

    &lt;input type="file" /&gt;
    &lt;input type="hidden" /&gt;
    &lt;input type="image" /&gt;

    &lt;input type="password" /&gt;
    &lt;input type="radio" /&gt;
    &lt;input type="reset" /&gt;

    &lt;input type="submit" /&gt;
    &lt;input type="text" /&gt;
    &lt;select&gt;&lt;option&gt;Option&lt;option/&gt;&lt;/select&gt;

    &lt;textarea&gt;&lt;/textarea&gt;
    &lt;button&gt;Button&lt;/button&gt;
  &lt;/form&gt;
  &lt;div&gt;
  &lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-filter-expr">
<span class="fn"><a class="name" href="#link-filter-expr">filter</a>( <span class="arg-type tooltip" title="">Expression</span> <span class="arg-name tooltip" title="An expression to pass into the filter">expr</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Removes all elements from the set of matched elements that do not match the specified expression(s). <br>This method is used to narrow down the results of a search.<br>
<br>Provide a comma-separated list of expressions to apply multiple filters at once.</div>
<div class="example">
<h3>Example:</h3>
<p>Change the color of all divs then put a border around only some of them.</p>
<pre>
<code class="javascript">

    $("div").css("background", "#c8ebcc")
            .filter(".middle")
            .css("border-color", "red");
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;&lt;/div&gt;

  &lt;div class="middle"&gt;&lt;/div&gt;
  &lt;div class="middle"&gt;&lt;/div&gt;
  &lt;div class="middle"&gt;&lt;/div&gt;
  &lt;div class="middle"&gt;&lt;/div&gt;

  &lt;div&gt;&lt;/div&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Selects all paragraphs and removes those without a class "selected".</p>
<pre>
<code class="javascript">$("p").filter(".selected")</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Selects all paragraphs and removes those that aren't of class "selected" or the first one.</p>
<pre>
<code class="javascript">$("p").filter(".selected, :first")</code>
</pre>
</div>
</div>
</li>
<li id="link-filter-fn">
<span class="fn"><a class="name" href="#link-filter-fn">filter</a>( <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="A function to pass into the filter

<pre>function callback(indexInJQueryObject) {
  var keepItBoolean = true;

  this; // dom element

  return keepItBoolean;
}
</pre>">fn</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Removes all elements from the set of matched elements that does not match the specified function. <br>The function is called with a context equal to the current element (just like &lt;a href='Core/each'&gt;$.each&lt;/a&gt;). If the function returns false, then the element is removed - anything else and the element is kept.</div>
<div class="example">
<h3>Example:</h3>
<p>Change the color of all divs then put a border two specific ones.</p>
<pre>
<code class="javascript">
    $("div").css("background", "#b4b0da")
            .filter(function (index) {
                  return index == 1 || $(this).attr("id") == "fourth";
                })
            .css("border", "3px double red");

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div id="first"&gt;&lt;/div&gt;
  &lt;div id="second"&gt;&lt;/div&gt;
  &lt;div id="third"&gt;&lt;/div&gt;

  &lt;div id="fourth"&gt;&lt;/div&gt;
  &lt;div id="fifth"&gt;&lt;/div&gt;
  &lt;div id="sixth"&gt;&lt;/div&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Remove all elements that have a descendant ol element</p>
<pre>
<code class="javascript"> $("p").filter(function(index) {
   return $("ol", this).length == 0;
 });</code>
</pre>
</div>
</div>
</li>
<li id="link-find-expr">
<span class="fn"><a class="name" href="#link-find-expr">find</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="An expression to search with.">expr</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Searches for all elements that match the specified &lt;a href='Selectors'&gt;expression&lt;/a&gt;. This method is a good way to find additional descendant elements with which to process.<br>All searching is done using a &lt;a href='Selectors'&gt;jQuery expression&lt;/a&gt;. The expression can be written using CSS 1-3 Selector syntax. </div>
<div class="example">
<h3>Example:</h3>
<p>Starts with all paragraphs and searches for descendant span elements, same as $("p span")</p>
<pre>
<code class="javascript">$("p").find("span").css('color','red');</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;&lt;span&gt;Hello&lt;/span&gt;, how are you?&lt;/p&gt;

  &lt;p&gt;Me? I'm &lt;span&gt;good&lt;/span&gt;.&lt;/p&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Add spans around each word then add a hover and italicize words with the letter '''t'''.</p>
<pre>
<code class="javascript">
    var newText = $("p").text().split(" ").join("&lt;/span&gt; &lt;span&gt;");
    newText = "&lt;span&gt;" + newText + "&lt;/span&gt;";

    $("p").html(newText)
          .find("span")
            .hover(function () { $(this).addClass("hilite"); },
                   function () { $(this).removeClass("hilite"); })
          .end()
          .find(":contains('t')")
            .css({"font-style":"italic", "font-weight":"bolder"});

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;
    When the day is short
    find that which matters to you
    or stop believing
  &lt;/p&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-first-">
<span class="fn"><a class="name" href="#link-first-">first</a>(  ) returns <span class="type"><span class="tooltip" title="The Javascript object representation of a DOM Element.">Element</span></span></span>
<div class="more">
<div class="desc">Matches the first selected element.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Finds the first table row.</p>
<pre>
<code class="javascript">$("tr:first").css("font-style", "italic");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;table&gt;
    &lt;tr&gt;&lt;td&gt;Row 1&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;Row 2&lt;/td&gt;&lt;/tr&gt;

    &lt;tr&gt;&lt;td&gt;Row 3&lt;/td&gt;&lt;/tr&gt;
  &lt;/table&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-firstChild-">
<span class="fn"><a class="name" href="#link-firstChild-">firstChild</a>(  ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Matches the first child of its parent.<br>While &lt;a href='Selectors/first'&gt;:first&lt;/a&gt; matches only a single element, this matches more then one: One for each parent.</div>
<div class="example">
<h3>Example:</h3>
<p>Finds the first span in each matched div to underline and add a hover state.</p>
<pre>
<code class="javascript">
    $("div span:first-child")
        .css("text-decoration", "underline")
        .hover(function () {
              $(this).addClass("sogreen");
            }, function () {
              $(this).removeClass("sogreen");
            });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;
    &lt;span&gt;John,&lt;/span&gt;
    &lt;span&gt;Karl,&lt;/span&gt;
    &lt;span&gt;Brandon&lt;/span&gt;

  &lt;/div&gt;
  &lt;div&gt;
    &lt;span&gt;Glen,&lt;/span&gt;
    &lt;span&gt;Tane,&lt;/span&gt;
    &lt;span&gt;Ralph&lt;/span&gt;

  &lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-focus-">
<span class="fn"><a class="name" href="#link-focus-">focus</a>(  ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Triggers the focus event of each matched element. <br>This causes all of the functions that have been bound to the focus event to be executed. Note that this does not execute the focus method of the underlying elements.</div>
<div class="example">
<h3>Example:</h3>
<p>To focus on a login input box with id 'login' on page startup, try:</p>
<pre>
<code class="javascript">$(document).ready(function(){
  $("#login").focus();
});</code>
</pre>
</div>
</div>
</li>
<li id="link-focus-fn">
<span class="fn"><a class="name" href="#link-focus-fn">focus</a>( <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="A function to bind to the focus event on each of the matched elements.

<pre>function callback(eventObject) {
  this; // dom element
}
</pre>">fn</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Binds a function to the focus event of each matched element.<br>The focus event fires when an element receives focus either via the pointing device or by tab navigation.</div>
<div class="example">
<h3>Example:</h3>
<p>To stop people from writing in text input boxes, try:</p>
<pre>
<code class="javascript">$("input[@type=text]").focus(function(){
  $(this).blur();
});</code>
</pre>
</div>
</div>
</li>
<li id="link-get-">
<span class="fn"><a class="name" href="#link-get-">get</a>(  ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Access all matched DOM elements.<br>This serves as a backwards-compatible way of accessing all matched elements (other than the jQuery object itself, which is, in fact, an array of elements).<br>
<br>It is useful if you need to operate on the DOM elements themselves instead of using built-in jQuery functions. </div>
<div class="example">
<h3>Example:</h3>
<p>Selects all divs in the document and returns the DOM Elements as an Array, then uses the built-in reverse-method to reverse that array.</p>
<pre>
<code class="javascript">

    function disp(divs) {
      var a = [];
      for (var i = 0; i &lt; divs.length; i++) {
        a.push(divs[i].innerHTML);
      }
      $("span").text(a.join(" "));
    }
    
    disp( $("div").get().reverse() );
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">Reversed - &lt;span&gt;&lt;/span&gt;

  &lt;div&gt;One&lt;/div&gt;
  &lt;div&gt;Two&lt;/div&gt;
  &lt;div&gt;Three&lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-get-index">
<span class="fn"><a class="name" href="#link-get-index">get</a>( <span class="arg-type tooltip" title="A valid numeric.">Number</span> <span class="arg-name tooltip" title="Access the element in the Nth position.">index</span> ) returns <span class="type"><span class="tooltip" title="The Javascript object representation of a DOM Element.">Element</span></span></span>
<div class="more">
<div class="desc">Access a single matched DOM element at a specified index in the matched set.<br>This allows you to extract the actual DOM element and operate on it directly without necessarily using jQuery functionality on it. This function called as $(this).get(0) is the equivalent of using square bracket notation on the jQuery object itself like $(this)[0].</div>
<div class="example">
<h3>Example:</h3>
<p>Gives the tag name of the element clicked on.</p>
<pre>
<code class="javascript">

    $("*", document.body).click(function (e) {
      e.stopPropagation();
      var domEl = $(this).get(0);
      $("span:first").text("Clicked on - " + domEl.tagName);
    });
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;span&gt;&amp;nbsp;&lt;/span&gt;
  &lt;p&gt;In this paragraph is an &lt;span&gt;important&lt;/span&gt; section&lt;/p&gt;

  &lt;div&gt;&lt;input type="text" /&gt;&lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-gt-index">
<span class="fn"><a class="name" href="#link-gt-index">gt</a>( <span class="arg-type tooltip" title="A valid numeric.">Number</span> <span class="arg-name tooltip" title="Zero-based index.">index</span> ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Matches all elements with an index above the given one.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Finds TD #5 and higher. Reminder: the indexing starts at 0.</p>
<pre>
<code class="javascript">$("td:gt(4)").css("text-decoration", "line-through");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;table border="1"&gt;

    &lt;tr&gt;&lt;td&gt;TD #0&lt;/td&gt;&lt;td&gt;TD #1&lt;/td&gt;&lt;td&gt;TD #2&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;TD #3&lt;/td&gt;&lt;td&gt;TD #4&lt;/td&gt;&lt;td&gt;TD #5&lt;/td&gt;&lt;/tr&gt;

    &lt;tr&gt;&lt;td&gt;TD #6&lt;/td&gt;&lt;td&gt;TD #7&lt;/td&gt;&lt;td&gt;TD #8&lt;/td&gt;&lt;/tr&gt;
  &lt;/table&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-has-selector">
<span class="fn"><a class="name" href="#link-has-selector">has</a>( <span class="arg-type tooltip" title="">Selector</span> <span class="arg-name tooltip" title="A selector with which to filter by.">selector</span> ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Matches elements which contain at least one element that matches the specified selector.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Adds the class "test" to all divs that have a paragraph inside of them.</p>
<pre>
<code class="javascript">$("div:has(p)").addClass("test");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;&lt;p&gt;Hello in a paragraph&lt;/p&gt;&lt;/div&gt;

  &lt;div&gt;Hello again! (with no paragraph)&lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-hasClass-class">
<span class="fn"><a class="name" href="#link-hasClass-class">hasClass</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="The class to match.">class</span> ) returns <span class="type"><span class="tooltip" title="true or false.">Boolean</span></span></span>
<div class="more">
<div class="desc">Checks the current selection against a class and returns true, if at least one element of the selection has the given class.<br>This is an alternative to is("." + class).</div>
<div class="example">
<h3>Example:</h3>
<p>Check to see if an element has a specific class, and if so, perform an action.</p>
<pre>
<code class="javascript">

    $("div").click(function(){
      if ( $(this).hasClass("protected") )
        $(this).animate({ left: -10 }, 75)
               .animate({ left: 10 }, 75)
               .animate({ left: -10 }, 75)
               .animate({ left: 10 }, 75)
               .animate({ left: 0 }, 75);
    });
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;span&gt;&lt;/span&gt;&lt;div class="protected"&gt;&lt;/div&gt;
  &lt;span&gt;&lt;/span&gt;&lt;div&gt;&lt;/div&gt;

  &lt;span&gt;&lt;/span&gt;&lt;div&gt;&lt;/div&gt;
  &lt;span&gt;&lt;/span&gt;&lt;div class="protected"&gt;&lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-header-">
<span class="fn"><a class="name" href="#link-header-">header</a>(  ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Matches all elements that are headers, like h1, h2, h3 and so on.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Adds a background and text color to all the headers on the page.</p>
<pre>
<code class="javascript">$(":header").css({ background:'#CCC', color:'blue' });</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;h1&gt;Header 1&lt;/h1&gt;

  &lt;p&gt;Contents 1&lt;/p&gt;
  &lt;h2&gt;Header 2&lt;/h2&gt;
  &lt;p&gt;Contents 2&lt;/p&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-height-">
<span class="fn"><a class="name" href="#link-height-">height</a>(  ) returns <span class="type"><span class="tooltip" title="">Integer</span></span></span>
<div class="more">
<div class="desc">Get the current computed, pixel, height of the first matched element.<br>In jQuery 1.2, this method is able to find the height of the window and document.</div>
<div class="example">
<h3>Example:</h3>
<p>Show various heights.  Note the values are from the iframe so might be smaller than you expected.  The yellow highlight shows the iframe body.</p>
<pre>
<code class="javascript">
    function showHeight(ele, h) {
      $("div").text("The height for the " + ele + 
                    " is " + h + "px.");
    }
    $("#getp").click(function () { 
      showHeight("paragraph", $("p").height()); 
    });
    $("#getd").click(function () { 
      showHeight("document", $(document).height()); 
    });
    $("#getw").click(function () { 
      showHeight("window", $(window).height()); 
    });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;button id="getp"&gt;Get Paragraph Height&lt;/button&gt;
  &lt;button id="getd"&gt;Get Document Height&lt;/button&gt;
  &lt;button id="getw"&gt;Get Window Height&lt;/button&gt;

  &lt;div&gt;&amp;nbsp;&lt;/div&gt;
  &lt;p&gt;
    Sample paragraph to test height
  &lt;/p&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-height-val">
<span class="fn"><a class="name" href="#link-height-val">height</a>( <span class="arg-type tooltip" title="">String or Number</span> <span class="arg-name tooltip" title="Set the CSS 'height' property to the specified value.">val</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Set the CSS height of every matched element.<br>If no explicit unit was specified (like 'em' or '%') then "px" is concatenated to the value.</div>
<div class="example">
<h3>Example:</h3>
<p>To set the height of each div on click to 30px plus a color change.</p>
<pre>
<code class="javascript">

    $("div").one('click', function () {
      $(this).height(30)
             .css({cursor:"auto", backgroundColor:"green"});
    });
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;

  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-hidden-">
<span class="fn"><a class="name" href="#link-hidden-">hidden</a>(  ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Matches all elements that are hidden, or input elements of type "hidden".<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Shows all hidden divs and counts hidden inputs.</p>
<pre>
<code class="javascript">
    // in some browsers :hidden includes head, title, script, etc... so limit to body
    $("span:first").text("Found " + $(":hidden", document.body).length + 
                         " hidden elements total.");
    $("div:hidden").show(3000);
    $("span:last").text("Found " + $("input:hidden").length + " hidden inputs.");

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;span&gt;&lt;/span&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div style="display:none;"&gt;Hider!&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;

  &lt;div class="starthidden"&gt;Hider!&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;form&gt;
    &lt;input type="hidden" /&gt;

    &lt;input type="hidden" /&gt;
    &lt;input type="hidden" /&gt;
  &lt;/form&gt;
  &lt;span&gt;

  &lt;/span&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-hidden-">
<span class="fn"><a class="name" href="#link-hidden-">hidden</a>(  ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Matches all elements that are hidden, or input elements of type "hidden".<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Shows all hidden divs and counts hidden inputs.</p>
<pre>
<code class="javascript">

    // in some browsers :hidden includes head, title, script, etc... so limit to body
    $("span:first").text("Found " + $(":hidden", document.body).length + 
                         " hidden elements total.");
    $("div:hidden").show(3000);
    $("span:last").text("Found " + $("input:hidden").length + " hidden inputs.");

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;span&gt;&lt;/span&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div style="display:none;"&gt;Hider!&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;

  &lt;div class="starthidden"&gt;Hider!&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;form&gt;
    &lt;input type="hidden" /&gt;

    &lt;input type="hidden" /&gt;
    &lt;input type="hidden" /&gt;
  &lt;/form&gt;
  &lt;span&gt;

  &lt;/span&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-hide-">
<span class="fn"><a class="name" href="#link-hide-">hide</a>(  ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Hides each of the set of matched elements if they are shown.<br>Same as &lt;a href='Effects/hide#speedcallback'&gt;hide( speed, [callback] )&lt;/a&gt; without animations. Doesn't change anything if the selected elements are all hidden.</div>
<div class="example">
<h3>Example:</h3>
<p>Hides all paragraphs then the link on click.</p>
<pre>
<code class="javascript">

    $("p").hide();
    $("a").click(function () {
      $(this).hide();
      return false;
    });
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;Hello&lt;/p&gt;
  &lt;a href="#"&gt;Click to hide me too&lt;/a&gt;
  &lt;p&gt;Here is another paragraph&lt;/p&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-hide-speedcallback">
<span class="fn"><a class="name" href="#link-hide-speedcallback">hide</a>( <span class="arg-type tooltip" title="">String, Number </span> <span class="arg-name tooltip" title="A string representing one of the three predefined speeds (&quot;slow&quot;, &quot;normal&quot;, or &quot;fast&quot;) or the number of milliseconds to run the animation (e.g. 1000).">speed</span>, <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="A function to be executed whenever the animation completes, executes once for each element animated against.

<pre>function callback() {
  this; // dom element
}
</pre>">callback</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Hide all matched elements using a graceful animation and firing an optional callback after completion.<br>The height, width, and opacity of each of the matched elements are changed dynamically according to the specified speed.</div>
<div class="example">
<h3>Example:</h3>
<p>Animates all shown paragraphs to hide slowly, completing the animation within 600 milliseconds.</p>
<pre>
<code class="javascript">
    $("button").click(function () {
      $("p").hide("slow");
    });    
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;button&gt;Hide 'em&lt;/button&gt;

  &lt;p&gt;Hiya&lt;/p&gt;
  &lt;p&gt;Such interesting text, eh?&lt;/p&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Animates all spans (words in this case) to hide fastly, completing each animation within 200 milliseconds. Once each animation is done, it starts the next one.</p>
<pre>
<code class="javascript">
    $("#hidr").click(function () {
      $("span:last-child").hide("fast", function () {
        // use callee so don't have to name the function
        $(this).prev().hide("fast", arguments.callee); 
      });
    });
    $("#showr").click(function () {
      $("span").show(2000);
    });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;button id="hidr"&gt;Hide&lt;/button&gt;
  &lt;button id="showr"&gt;Show&lt;/button&gt;
  &lt;div&gt;

    &lt;span&gt;Once&lt;/span&gt; &lt;span&gt;upon&lt;/span&gt; &lt;span&gt;a&lt;/span&gt; 
    &lt;span&gt;time&lt;/span&gt; &lt;span&gt;there&lt;/span&gt; &lt;span&gt;were&lt;/span&gt; 
    &lt;span&gt;three&lt;/span&gt; &lt;span&gt;programmers...&lt;/span&gt;

  &lt;/div&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Hides the divs when clicked over 2 seconds, then removes the div element when its hidden.  Try clicking on more than one box at a time.</p>
<pre>
<code class="javascript">
    for (var i = 0; i &lt; 5; i++) {
      $("&lt;div&gt;").appendTo(document.body);
    }
    $("div").click(function () {
      $(this).hide(2000, function () {
        $(this).remove();
      });
    });
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;&lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-hover-overout">
<span class="fn"><a class="name" href="#link-hover-overout">hover</a>( <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="The function to fire when the mouse is moved over a matched element.

<pre>function callback(eventObject) {
  this; // dom element
}
</pre>">over</span>, <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="The function to fire when the mouse is moved off of a matched element.
<pre>function callback(eventObject) {
  this; // dom element
}
</pre>">out</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Simulates hovering (moving the mouse on, and off, an object). This is a custom method which provides an 'in' to a frequent task.<br>Whenever the mouse cursor is moved over a matched element, the first specified function is fired. Whenever the mouse moves off of the element, the second specified function fires. Additionally, checks are in place to see if the mouse is still within the specified element itself (for example, an image inside of a div), and if it is, it will continue to 'hover', and not move out (a common error in using a mouseout event handler).</div>
<div class="example">
<h3>Example:</h3>
<p>To add a special style to table cells that are being hovered over, try:</p>
<pre>
<code class="javascript">
    $("li").hover(
      function () {
        $(this).append($("&lt;span&gt; ***&lt;/span&gt;"));
      }, 
      function () {
        $(this).find("span:last").remove();
      }
    );

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;ul&gt;
    &lt;li&gt;Milk&lt;/li&gt;
    &lt;li&gt;Bread&lt;/li&gt;
    &lt;li&gt;Chips&lt;/li&gt;

    &lt;li&gt;Socks&lt;/li&gt;
  &lt;/ul&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>To add a special style to table cells that are being hovered over, try:</p>
<pre>
<code class="javascript">$("td").hover(
  function () {
    $(this).addClass("hover");
  },
  function () {
    $(this).removeClass("hover");
  }
);</code>
</pre>
</div>
</div>
</li>
<li id="link-html-">
<span class="fn"><a class="name" href="#link-html-">html</a>(  ) returns <span class="type"><span class="tooltip" title="A string of characters.">String</span></span></span>
<div class="more">
<div class="desc">Get the html contents (innerHTML) of the first matched element. This property is not available on XML documents (although it will work for XHTML documents).<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Click a paragraph to convert it from html to text.</p>
<pre>
<code class="javascript">

    $("p").click(function () {
      var htmlStr = $(this).html();
      $(this).text(htmlStr);
    });
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;
    &lt;b&gt;Click&lt;/b&gt; to change the &lt;span id="tag"&gt;html&lt;/span&gt;

  &lt;/p&gt;
  &lt;p&gt;
    to a &lt;span id="text"&gt;text&lt;/span&gt; node.
  &lt;/p&gt;
  &lt;p&gt;

    This &lt;button name="nada"&gt;button&lt;/button&gt; does nothing.
  &lt;/p&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-html-">
<span class="fn"><a class="name" href="#link-html-">html</a>(  ) returns <span class="type"><span class="tooltip" title="A string of characters.">String</span></span></span>
<div class="more">
<div class="desc">Get the html contents (innerHTML) of the first matched element. This property is not available on XML documents (although it will work for XHTML documents).<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Click a paragraph to convert it from html to text.</p>
<pre>
<code class="javascript">

    $("p").click(function () {
      var htmlStr = $(this).html();
      $(this).text(htmlStr);
    });
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;
    &lt;b&gt;Click&lt;/b&gt; to change the &lt;span id="tag"&gt;html&lt;/span&gt;

  &lt;/p&gt;
  &lt;p&gt;
    to a &lt;span id="text"&gt;text&lt;/span&gt; node.
  &lt;/p&gt;
  &lt;p&gt;

    This &lt;button name="nada"&gt;button&lt;/button&gt; does nothing.
  &lt;/p&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-html-val">
<span class="fn"><a class="name" href="#link-html-val">html</a>( <span class="arg-type tooltip" title="">string</span> <span class="arg-name tooltip" title="Set the html contents to the specified value.">val</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Set the html contents of every matched element. This property is not available on XML documents (although it will work for XHTML documents).<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Add some html to each div.</p>
<pre>
<code class="javascript">$("div").html("&lt;span class='red'&gt;Hello &lt;b&gt;Again&lt;/b&gt;&lt;/span&gt;");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;span&gt;Hello&lt;/span&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Add some html to each div then immediately do further manipulations to the inserted html.</p>
<pre>
<code class="javascript">

    $("div").html("&lt;b&gt;Wow!&lt;/b&gt; Such excitement...");
    $("div b").append(document.createTextNode("!!!"))
              .css("color", "red");

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-html-val">
<span class="fn"><a class="name" href="#link-html-val">html</a>( <span class="arg-type tooltip" title="">string</span> <span class="arg-name tooltip" title="Set the html contents to the specified value.">val</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Set the html contents of every matched element. This property is not available on XML documents (although it will work for XHTML documents).<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Add some html to each div.</p>
<pre>
<code class="javascript">$("div").html("&lt;span class='red'&gt;Hello &lt;b&gt;Again&lt;/b&gt;&lt;/span&gt;");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;span&gt;Hello&lt;/span&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Add some html to each div then immediately do further manipulations to the inserted html.</p>
<pre>
<code class="javascript">

    $("div").html("&lt;b&gt;Wow!&lt;/b&gt; Such excitement...");
    $("div b").append(document.createTextNode("!!!"))
              .css("color", "red");

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-id-id">
<span class="fn"><a class="name" href="#link-id-id">id</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="An ID to search for, specified via the id attribute of an element.">id</span> ) returns <span class="type"><span class="tooltip" title="The Javascript object representation of a DOM Element.">Element</span></span></span>
<div class="more">
<div class="desc">Matches a single element with the given id attribute. <br>If the id contains characters like periods or colons you have to escape those characters with backslashes [http://docs.jquery.com/Frequently_Asked_Questions#How_do_I_select_an_element_that_has_weird_characters_in_its_ID.3F].</div>
<div class="example">
<h3>Example:</h3>
<p>Finds the element with the id "myDiv".</p>
<pre>
<code class="javascript">$("#myDiv").css("border","3px solid red");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div id="notMe"&gt;&lt;p&gt;id="notMe"&lt;/p&gt;&lt;/div&gt;

  &lt;div id="myDiv"&gt;id="myDiv"&lt;/div&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Finds the element with the id "myID.entry[1]".  See how certain characters must be escaped with backslashes.</p>
<pre>
<code class="javascript">$("#myID\\.entry\\[1\\]").css("border","3px solid red");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div id="myID.entry[0]"&gt;id="myID.entry[0]"&lt;/div&gt;

  &lt;div id="myID.entry[1]"&gt;id="myID.entry[1]"&lt;/div&gt;
  &lt;div id="myID.entry[2]"&gt;id="myID.entry[2]"&lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-image-">
<span class="fn"><a class="name" href="#link-image-">image</a>(  ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Matches all input elements of type image.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Finds all image inputs.</p>
<pre>
<code class="javascript">

    var input = $(":image").css({background:"yellow", border:"3px red solid"});
    $("div").text("For this type jQuery found " + input.length + ".")
            .css("color", "red");
    $("form").submit(function () { return false; }); // so it won't submit

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;form&gt;
    &lt;input type="button" value="Input Button"/&gt;
    &lt;input type="checkbox" /&gt;

    &lt;input type="file" /&gt;
    &lt;input type="hidden" /&gt;
    &lt;input type="image" /&gt;

    &lt;input type="password" /&gt;
    &lt;input type="radio" /&gt;
    &lt;input type="reset" /&gt;

    &lt;input type="submit" /&gt;
    &lt;input type="text" /&gt;
    &lt;select&gt;&lt;option&gt;Option&lt;option/&gt;&lt;/select&gt;

    &lt;textarea&gt;&lt;/textarea&gt;
    &lt;button&gt;Button&lt;/button&gt;
  &lt;/form&gt;
  &lt;div&gt;
  &lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-index-subject">
<span class="fn"><a class="name" href="#link-index-subject">index</a>( <span class="arg-type tooltip" title="">Element </span> <span class="arg-name tooltip" title="Object to search for.">subject</span> ) returns <span class="type"><span class="tooltip" title="A valid numeric.">Number</span></span></span>
<div class="more">
<div class="desc">Searches every matched element for the object and returns the index of the element, if found, starting with zero.<br>Returns -1 if the object wasn't found.</div>
<div class="example">
<h3>Example:</h3>
<p>On click, returns the index (based zero) of that div in the page.</p>
<pre>
<code class="javascript">
    $("div").click(function () {
      // this is the dom element clicked
      var index = $("div").index(this);
      $("span").text("That was div index #" + index);
    });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;span&gt;Click a div!&lt;/span&gt;
  &lt;div&gt;First div&lt;/div&gt;
  &lt;div&gt;Second div&lt;/div&gt;

  &lt;div&gt;Third div&lt;/div&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Returns the index for the element with ID foobar.</p>
<pre>
<code class="javascript">$("*").index( $('#foobar')[0] )</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div id="foobar"&gt;&lt;b&gt;&lt;/b&gt;&lt;span id="foo"&gt;&lt;/span&gt;&lt;/div&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Returns the index for the element with ID foo within another element.</p>
<pre>
<code class="javascript">$("*").index( $('#foo')[0] )</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div id="foobar"&gt;&lt;b&gt;&lt;/b&gt;&lt;span id="foo"&gt;&lt;/span&gt;&lt;/div&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Returns the index for the element clicked within a collection.</p>
<pre>
<code class="javascript">var mainNavLinks = $('ul#mainNav li a');
mainNavLinks.click(function(){alert(mainNavLinks.index(this)0;});</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Returns -1, as there is no element with ID bar.</p>
<pre>
<code class="javascript">$("*").index( $('#bar')[0] )</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div id="foobar"&gt;&lt;b&gt;&lt;/b&gt;&lt;span id="foo"&gt;&lt;/span&gt;&lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-input-">
<span class="fn"><a class="name" href="#link-input-">input</a>(  ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Matches all input, textarea, select and button elements.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Finds all input elements.</p>
<pre>
<code class="javascript">

    var allInputs = $(":input");
    var formChildren = $("form &gt; *");
    $("div").text("Found " + allInputs.length + " inputs and the form has " +
                             formChildren.length + " children.")
            .css("color", "red");
    $("form").submit(function () { return false; }); // so it won't submit

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;form&gt;
    &lt;input type="button" value="Input Button"/&gt;
    &lt;input type="checkbox" /&gt;

    &lt;input type="file" /&gt;
    &lt;input type="hidden" /&gt;
    &lt;input type="image" /&gt;

    &lt;input type="password" /&gt;
    &lt;input type="radio" /&gt;
    &lt;input type="reset" /&gt;

    &lt;input type="submit" /&gt;
    &lt;input type="text" /&gt;
    &lt;select&gt;&lt;option&gt;Option&lt;/option&gt;&lt;/select&gt;

    &lt;textarea&gt;&lt;/textarea&gt;
    &lt;button&gt;Button&lt;/button&gt;
  &lt;/form&gt;
  &lt;div&gt;
  &lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-insertAfter-content">
<span class="fn"><a class="name" href="#link-insertAfter-content">insertAfter</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="Content after which the selected element(s) is inserted.">content</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Insert all of the matched elements after another, specified, set of elements.<br>This operation is, essentially, the reverse of doing a regular $(A).after(B), in that instead of inserting B after A, you're inserting A after B.</div>
<div class="example">
<h3>Example:</h3>
<p>Inserts all paragraphs after an element with id of "foo". Same as $("#foo").after("p")</p>
<pre>
<code class="javascript">$("p").insertAfter("#foo"); // check after() examples</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt; is what I said... &lt;/p&gt;&lt;div id="foo"&gt;FOO!&lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-insertBefore-content">
<span class="fn"><a class="name" href="#link-insertBefore-content">insertBefore</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="Content after which the selected element(s) is inserted.">content</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Insert all of the matched elements before another, specified, set of elements.<br>This operation is, essentially, the reverse of doing a regular $(A).before(B), in that instead of inserting B before A, you're inserting A before B.</div>
<div class="example">
<h3>Example:</h3>
<p>Inserts all paragraphs before an element with id of "foo". Same as $("#foo").before("p")</p>
<pre>
<code class="javascript">$("p").insertBefore("#foo"); // check before() examples</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div id="foo"&gt;FOO!&lt;/div&gt;&lt;p&gt;I would like to say: &lt;/p&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-is-expr">
<span class="fn"><a class="name" href="#link-is-expr">is</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="The expression with which to filter">expr</span> ) returns <span class="type"><span class="tooltip" title="true or false.">Boolean</span></span></span>
<div class="more">
<div class="desc">Checks the current selection against an expression and returns true, if at least one element of the selection fits the given expression.<br>If no element fits, or the expression is not valid, then the response will be 'false'.<br>
<br>
&lt;a href='Traversing/filter'&gt;filter&lt;/a&gt; is used internally, therefore all rules that apply there apply here, as well. </div>
<div class="example">
<h3>Example:</h3>
<p>Shows a few ways is() can be used inside an event handler.</p>
<pre>
<code class="javascript">
    $("div").one('click', function () {
      if ($(this).is(":first-child")) {
        $("p").text("It's the first div.");
      } else if ($(this).is(".blue,.red")) {
        $("p").text("It's a blue or red div.");
      } else if ($(this).is(":contains('Peter')")) {
        $("p").text("It's Peter!");
      } else {
        $("p").html("It's nothing &lt;em&gt;special&lt;/em&gt;.");
      }
      $("p").hide().slideDown("slow");
      $(this).css({"border-style": "inset", cursor:"default"});
    });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;&lt;/div&gt;
  &lt;div class="blue"&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div class="red"&gt;&lt;/div&gt;

  &lt;div&gt;&lt;br/&gt;&lt;span&gt;Peter&lt;/span&gt;&lt;/div&gt;
  &lt;div class="blue"&gt;&lt;/div&gt;
  &lt;p&gt;&amp;nbsp;&lt;/p&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Returns true, because the parent of the input is a form element</p>
<pre>
<code class="javascript">

    var isFormParent = $("input[@type='checkbox']").parent().is("form")
    $("div").text("isFormParent = " + isFormParent);
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;form&gt;&lt;input type="checkbox" /&gt;&lt;/form&gt;

  &lt;div&gt;&lt;/div&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Returns false, because the parent of the input is a p element</p>
<pre>
<code class="javascript">
    var isFormParent = $("input[@type='checkbox']").parent().is("form")
    $("div").text("isFormParent = " + isFormParent);
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;form&gt;&lt;p&gt;&lt;input type="checkbox" /&gt;&lt;/p&gt;&lt;/form&gt;

  &lt;div&gt;&lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-jQuery-html">
<span class="fn"><a class="name" href="#link-jQuery-html">jQuery</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="A string of HTML to create on the fly.">html</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Create DOM elements on-the-fly from the provided String of raw HTML.<br>You can pass in plain HTML Strings written by hand, create them using some template engine or plugin, or load them via AJAX. There are limitations when creating input elements, see the second example. Also when passing strings that may include slashes (such as an image path), escape the slashes.  When creating single elements use the closing tag or XHTML format.  For example, to create a span use $("&lt;span/&gt;") or $("&lt;span&gt;&lt;/span&gt;") instead of without the closing slash/tag.</div>
<div class="example">
<h3>Example:</h3>
<p>Creates a div element (and all of its contents) dynamically, and appends it to the body element. Internally, an element is created and its innerHTML property set to the given markup. It is therefore both quite flexible and limited.</p>
<pre>
<code class="javascript">$("&lt;div&gt;&lt;p&gt;Hello&lt;/p&gt;&lt;/div&gt;").appendTo("body")</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Do not create &amp;lt;input&amp;gt;-Elements without a type-attribute, due to Microsofts read/write-once-rule for the type-attribute of &amp;lt;input&amp;gt;-elements, see this [http://msdn2.microsoft.com/en-us/library/ms534700.aspx official statement] for details.</p>
<pre>
<code class="javascript">// Does NOT work in IE:
$("&lt;input/&gt;").attr("type", "checkbox");
// Does work in IE:
$("&lt;input type='checkbox'/&gt;");</code>
</pre>
</div>
</div>
</li>
<li id="link-jQuery-elements">
<span class="fn"><a class="name" href="#link-jQuery-elements">jQuery</a>( <span class="arg-type tooltip" title="">Element, Array&lt;Element&gt;</span> <span class="arg-name tooltip" title="DOM element(s) to be encapsulated by a jQuery object.">elements</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Wrap jQuery functionality around a single or multiple DOM Element(s).<br>This function also accepts XML Documents and Window objects as valid arguments (even though they are not DOM Elements).</div>
<div class="example">
<h3>Example:</h3>
<p>Sets the background color of the page to black.</p>
<pre>
<code class="javascript">$(document.body).css( "background", "black" );</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Hides all the input elements within a form.</p>
<pre>
<code class="javascript">$(myForm.elements).hide()</code>
</pre>
</div>
</div>
</li>
<li id="link-jQuery-callback">
<span class="fn"><a class="name" href="#link-jQuery-callback">jQuery</a>( <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="The function to execute when the DOM is ready.">callback</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">A shorthand for $(document).ready().<br>Allows you to bind a function to be executed when the DOM document has finished loading. This function behaves just like $(document).ready(), in that it should be used to wrap other $() operations on your page that depend on the DOM being ready to be operated on. While this function is, technically, chainable - there really isn't much use for chaining against it.<br>
<br>You can have as many $(document).ready events on your page as you like.<br>
<br>See ready(Function) for details about the ready event. </div>
<div class="example">
<h3>Example:</h3>
<p>Executes the function when the DOM is ready to be used.</p>
<pre>
<code class="javascript">$(function(){
  // Document is ready
});</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Uses both the shortcut for $(document).ready() and the argument to write failsafe jQuery code using the $ alias, without relying on the global alias.</p>
<pre>
<code class="javascript">jQuery(function($) {
  // Your code using failsafe $ alias here...
});</code>
</pre>
</div>
</div>
</li>
<li id="link-jQuery-expressioncontext">
<span class="fn"><a class="name" href="#link-jQuery-expressioncontext">jQuery</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="An expression to search with.">expression</span>, <span class="arg-type tooltip" title="">Element, jQuery</span> <span class="arg-name tooltip" title="A DOM Element, Document or jQuery to use as context">context</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">This function accepts a string containing a CSS selector which is then used to match a set of elements.<br>The core functionality of jQuery centers around this function. Everything in jQuery is based upon this, or uses this in some way. The most basic use of this function is to pass in an expression (usually consisting of CSS), which then finds all matching elements.<br>
<br>By default, if no context is specified, $() looks for DOM elements within the context of the current HTML document. If you do specify a context, such as a DOM element or jQuery object, the expression will be matched against the contents of that context.<br>
<br>See &lt;a href='Selectors'&gt;Selectors&lt;/a&gt; for the allowed CSS syntax for expressions. </div>
<div class="example">
<h3>Example:</h3>
<p>Finds all p elements that are children of a div element.</p>
<pre>
<code class="javascript">$("div &gt; p").css("border", "1px solid gray");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;one&lt;/p&gt; &lt;div&gt;&lt;p&gt;two&lt;/p&gt;&lt;/div&gt; &lt;p&gt;three&lt;/p&gt;</code>
</pre>
<h4>Result:</h4>
<pre>
<code class="html">[ &lt;p&gt;two&lt;/p&gt; ]</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Finds all inputs of type radio within the first form in the document.</p>
<pre>
<code class="javascript">$("input:radio", document.forms[0]);</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Finds all div elements within an XML document from an AJAX response.</p>
<pre>
<code class="javascript">$("div", xml.responseXML);</code>
</pre>
</div>
</div>
</li>
<li id="link-jQueryajax-options">
<span class="fn"><a class="name" href="#link-jQueryajax-options">jQuery.ajax</a>( <span class="arg-type tooltip" title="">Options</span> <span class="arg-name tooltip" title="A set of key/value pairs that configure the Ajax request. All options are optional. A default can be set for any option with <a href='Ajax/jQuery.ajaxSetup'>$.ajaxSetup</a>().">options</span> ) returns <span class="type"><span class="tooltip" title="An XMLHttpRequest object (referencing a HTTP request).">XMLHttpRequest</span></span></span>
<div class="more">
<div class="desc">Load a remote page using an HTTP request.<br>This is jQuery's low-level AJAX implementation. See $.get, $.post etc. for higher-level abstractions that are often easier to understand and use, but don't offer as much functionality (such as error callbacks).<br>
<br>'''Warning: All POST are converted to GET when 'script' is the dataType.(because it loads script as a dom script tag)'''<br>
<br>$.ajax() returns the XMLHttpRequest that it creates. In most cases you won't need that object to manipulate directly, but it is available if you need to abort the request manually.<br>
<br>'''Note:''' If you specify the dataType option described below, make sure
the server sends the correct MIME type in the response (eg. xml as "text/xml").
Sending the wrong MIME type can lead to unexpected problems in your script.
See &lt;a href='Specifying_the_Data_Type_for_AJAX_Requests'&gt;Specifying the Data Type for AJAX Requests&lt;/a&gt; for more information.<br>
<br>$.ajax() takes one argument, an object of key/value pairs, that are used to initialize and handle the request. See below for a full list of the key/values that can be used.<br>
<br>As of jQuery 1.2, you can load JSON data located on another domain if you specify a [http://bob.pythonmac.org/archives/2005/12/05/remote-json-jsonp/ JSONP] callback, which can be done like so: "myurl?callback=?". jQuery automatically replaces the ? with the correct method name to call, calling your specified callback. Or, if you set the dataType to "jsonp" a callback will be automatically added to your Ajax request.</div>
<h3>Options</h3>
<ul class="options">
<li>
<span>async (<span class="arg-type tooltip" title="true or false.">Boolean</span>), default: true</span>
<div>By default, all requests are sent asynchronous (e.g. this is set to true by default). If you need synchronous requests, set this option to false. Note that synchronous requests may temporarily lock the browser, disabling any actions while the request is active.</div>
</li>
<li>
<span>beforeSend (<span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span>), default: </span>
<div>A pre-callback to modify the XMLHttpRequest object before it is sent. Use this to set custom headers etc. The XMLHttpRequest is passed as the only argument. This is an &lt;a href='Ajax_Events'&gt;Ajax Event&lt;/a&gt;.

&lt;pre&gt;function (XMLHttpRequest) {
  this; // the options for this ajax request
}
&lt;/pre&gt;</div>
</li>
<li>
<span>cache (<span class="arg-type tooltip" title="true or false.">Boolean</span>), default: true</span>
<div>Added in jQuery 1.2, if set to false it will force the pages that you request to not be cached by the browser.</div>
</li>
<li>
<span>complete (<span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span>), default: </span>
<div>A function to be called when the request finishes (after success and error callbacks are executed). The function gets passed two arguments: The XMLHttpRequest object and a string describing the type of success of the request. This is an &lt;a href='Ajax_Events'&gt;Ajax Event&lt;/a&gt;.
&lt;pre&gt;function (XMLHttpRequest, textStatus) {
  this; // the options for this ajax request
}
&lt;/pre&gt;</div>
</li>
<li>
<span>contentType (<span class="arg-type tooltip" title="A string of characters.">String</span>), default: "application/x-www-form-urlencoded"</span>
<div>When sending data to the server, use this content-type. Default is "application/x-www-form-urlencoded", which is fine for most cases.</div>
</li>
<li>
<span>data (<span class="arg-type tooltip" title="">Object, String</span>), default: </span>
<div>Data to be sent to the server. It is converted to a query string, if not already a string. It's appended to the url for GET-requests. See processData option to prevent this automatic processing. Object must be Key/Value pairs. If value is an Array, jQuery serializes multiple values with same key i.e. {foo:["bar1", "bar2"]} becomes '&amp;foo=bar1&amp;foo=bar2'.</div>
</li>
<li>
<span>dataType (<span class="arg-type tooltip" title="A string of characters.">String</span>), default: Intelligent Guess (xml or html)</span>
<div>The type of data that you're expecting back from the server. If none is specified, jQuery will intelligently pass either responseXML or responseText to your success callback, based on the MIME type of the response. The available types (and the result passed as the first argument to your success callback) are:
*"xml": Returns a XML document that can be processed via jQuery.
*"html": Returns HTML as plain text; included script tags are evaluated.
*'''warning "script" will turn posts into gets'''
*"script": Evaluates the response as JavaScript and returns it as plain text. Disables caching unless option "cache" is used.
*"json": Evaluates the response as JSON and returns a JavaScript Object.
*"jsonp": Loads in a JSON block using [http://bob.pythonmac.org/archives/2005/12/05/remote-json-jsonp/ JSONP]. Will add an extra "?callback=?" to the end of your URL to specify the callback. (Added in jQuery 1.2)
*"text": A plain text string.</div>
</li>
<li>
<span>error (<span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span>), default: </span>
<div>A function to be called if the request fails. The function gets passed three arguments: The XMLHttpRequest object, a string describing the type of error that occurred and an optional exception object, if one occurred. This is an &lt;a href='Ajax_Events'&gt;Ajax Event&lt;/a&gt;.

&lt;pre&gt;function (XMLHttpRequest, textStatus, errorThrown) {
  // typically only one of textStatus or errorThrown 
  // will have info
  this; // the options for this ajax request
}
&lt;/pre&gt;</div>
</li>
<li>
<span>global (<span class="arg-type tooltip" title="true or false.">Boolean</span>), default: true</span>
<div>Whether to trigger global AJAX event handlers for this request. The default is true. Set to false to prevent the global handlers like ajaxStart or ajaxStop from being triggered. This can be used to control various &lt;a href='Ajax_Events'&gt;Ajax Events&lt;/a&gt;.</div>
</li>
<li>
<span>ifModified (<span class="arg-type tooltip" title="true or false.">Boolean</span>), default: false</span>
<div>Allow the request to be successful only if the response has changed since the last request. This is done by checking the Last-Modified header. Default value is false, ignoring the header.</div>
</li>
<li>
<span>jsonp (<span class="arg-type tooltip" title="A string of characters.">String</span>), default: </span>
<div>Override the callback function name in a jsonp request.  This value will be used instead of 'callback' in the 'callback=?' part of the query string in the url for a GET or the data for a POST.  So {jsonp:'onJsonPLoad'} would result in 'onJsonPLoad=?' passed to the server.</div>
</li>
<li>
<span>processData (<span class="arg-type tooltip" title="true or false.">Boolean</span>), default: true</span>
<div>By default, data passed in to the data option as an object (technically, anything other than a string) will be processed and transformed into a query string, fitting to the default content-type "application/x-www-form-urlencoded". If you want to send DOMDocuments, or other non-processed data, set this option to false.</div>
</li>
<li>
<span>success (<span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span>), default: </span>
<div>A function to be called if the request succeeds. The function gets passed two arguments: The data returned from the server, formatted according to the 'dataType' parameter, and a string describing the status. This is an &lt;a href='Ajax_Events'&gt;Ajax Event&lt;/a&gt;.
&lt;pre&gt;function (data, textStatus) {
  // data could be xmlDoc, jsonObj, html, text, etc...
  this; // the options for this ajax request
}
&lt;/pre&gt;</div>
</li>
<li>
<span>timeout (<span class="arg-type tooltip" title="A valid numeric.">Number</span>), default: </span>
<div>Set a local timeout in ms for the request. This will override the global timeout, if one is set via &lt;a href='Ajax/jQuery.ajaxSetup'&gt;$.ajaxSetup&lt;/a&gt;. For example, you could use this property to give a single request a longer timeout than all other requests that you've set to time out in one second. See &lt;a href='Ajax/jQuery.ajaxSetup'&gt;$.ajaxSetup&lt;/a&gt;() for global timeouts.</div>
</li>
<li>
<span>type (<span class="arg-type tooltip" title="A string of characters.">String</span>), default: "GET"</span>
<div>The type of request to make ("POST" or "GET"), default is "GET". Note: Other HTTP request methods, such as PUT and DELETE, can also be used here, but they are not supported by all browsers.</div>
</li>
<li>
<span>url (<span class="arg-type tooltip" title="A string of characters.">String</span>), default: The current page</span>
<div>The URL to request.</div>
</li>
</ul>
<div class="example">
<h3>Example:</h3>
<p>Load and execute a JavaScript file.</p>
<pre>
<code class="javascript"> $.ajax({
   type: "GET",
   url: "test.js",
   dataType: "script"

 });</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Save some data to the server and notify the user once its complete.</p>
<pre>
<code class="javascript"> $.ajax({
   type: "POST",
   url: "some.php",
   data: "name=John&amp;location=Boston",
   success: function(msg){
     alert( "Data Saved: " + msg );
   }
 });</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Retrieve the latest version of an HTML page.</p>
<pre>
<code class="javascript">$.ajax({
  url: "test.html",
  cache: false,
  success: function(html){
    $("#results").append(html);
  }
});</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Loads data synchronously. Blocks the browser while the requests is active.
It is better to block user interaction by other means when synchronization is
necessary.</p>
<pre>
<code class="javascript"> var html = $.ajax({
  url: "some.php",
  async: false
 }).responseText;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Sends an xml document as data to the server. By setting the processData
option to false, the automatic conversion of data to strings is prevented.</p>
<pre>
<code class="javascript"> var xmlDocument = [create xml document];
 $.ajax({
   url: "page.php",
   processData: false,
   data: xmlDocument,
   success: handleResponse
 });</code>
</pre>
</div>
</div>
</li>
<li id="link-jQueryajaxSetup-options">
<span class="fn"><a class="name" href="#link-jQueryajaxSetup-options">jQuery.ajaxSetup</a>( <span class="arg-type tooltip" title="">Options</span> <span class="arg-name tooltip" title="A set of key/value pairs that configure the default Ajax request. All options are optional.">options</span> ) returns <span class="type"><span class="tooltip" title=""></span></span></span>
<div class="more">
<div class="desc">Setup global settings for AJAX requests.<br>See &lt;a href='Ajax/jQuery.ajax'&gt;$.ajax&lt;/a&gt; for a description of all available options.</div>
<div class="example">
<h3>Example:</h3>
<p>Sets the defaults for AJAX requests to the url "/xmlhttp/", disables global handlers and uses POST instead of GET. The following AJAX requests then sends some data without having to set anything else.</p>
<pre>
<code class="javascript"> $.ajaxSetup({
   url: "/xmlhttp/",
   global: false,
   type: "POST"

 });
 $.ajax({ data: myData });</code>
</pre>
</div>
</div>
</li>
<li id="link-jQueryboxModel-">
<span class="fn"><a class="name" href="#link-jQueryboxModel-">jQuery.boxModel</a> returns <span class="type"><span class="tooltip" title="true or false.">Boolean</span></span></span>
<div class="more">
<div class="desc">States if the current page, in the user's browser, is being rendered using the [http://www.w3.org/TR/REC-CSS2/box.html W3C CSS Box Model].<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Returns the box model for the iframe.</p>
<pre>
<code class="javascript">

    $("p").html("The box model for this iframe is: &lt;span&gt;" +
                jQuery.boxModel + "&lt;/span&gt;");
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;
  &lt;/p&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Returns false if the page is in QuirksMode in Internet Explorer</p>
<pre>
<code class="javascript">$.boxModel</code>
</pre>
<h4>Result:</h4>
<pre>
<code class="html">false</code>
</pre>
</div>
</div>
</li>
<li id="link-jQuerybrowser-">
<span class="fn"><a class="name" href="#link-jQuerybrowser-">jQuery.browser</a> returns <span class="type"><span class="tooltip" title="A Javascript object that contains key/value pairs in the form of properties and values.">Map</span></span></span>
<div class="more">
<div class="desc">Contains flags for the useragent, read from navigator.userAgent.<br>Available flags are:
* safari
* opera
* msie
* mozilla<br>
<br>This property is available before the DOM is ready, therefore you can use it to add ready events only for certain browsers.<br>
<br>There are situations where object detection is not reliable enough, in such cases it makes sense to use browser detection.<br>
<br>A combination of browser and object detection yields quite reliable results. </div>
<div class="example">
<h3>Example:</h3>
<p>Show the browser info.</p>
<pre>
<code class="javascript">

    jQuery.each(jQuery.browser, function(i, val) {
      $("&lt;div&gt;" + i + " : &lt;span&gt;" + val + "&lt;/span&gt;")
                .appendTo(document.body);
    });
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;Browser info:&lt;/p&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Returns true if the current useragent is some version of Microsoft's Internet Explorer</p>
<pre>
<code class="javascript">$.browser.msie</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Alerts "this is safari!" only for safari browsers</p>
<pre>
<code class="javascript">if ($.browser.safari) {
    alert("this is safari!");
 }</code>
</pre>
</div>
</div>
</li>
<li id="link-jQuerybrowserversion-">
<span class="fn"><a class="name" href="#link-jQuerybrowserversion-">jQuery.browser.version</a> returns <span class="type"><span class="tooltip" title="A string of characters.">String</span></span></span>
<div class="more">
<div class="desc">The version number of the rendering engine for the user's browser.<br>Here are some typical results:
* Internet Explorer: 6.0, 7.0
* Mozilla/Firefox/Flock/Camino: 1.7.12, 1.8.1.3
* Opera: 9.20
* Safari/Webkit: 312.8, 418.9</div>
<div class="example">
<h3>Example:</h3>
<p>Returns the browser version.</p>
<pre>
<code class="javascript">

    $("p").html("The browser version is: &lt;span&gt;" +
                jQuery.browser.version + "&lt;/span&gt;");
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;
  &lt;/p&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Alerts the version of IE that is being used</p>
<pre>
<code class="javascript">if ( $.browser.msie )
  alert( $.browser.version );
}</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Often you only care about the "major number," the whole number. This can be accomplished with JavaScript's built-in parseInt() function:</p>
<pre>
<code class="javascript">

if (jQuery.browser.msie) {
  alert(parseInt(jQuery.browser.version));
}
</code>
</pre>
</div>
</div>
</li>
<li id="link-jQuerydata-elem">
<span class="fn"><a class="name" href="#link-jQuerydata-elem">jQuery.data</a>( <span class="arg-type tooltip" title="The Javascript object representation of a DOM Element.">Element</span> <span class="arg-name tooltip" title="DOM element of interest.">elem</span> ) returns <span class="type"><span class="tooltip" title="A valid numeric.">Number</span></span></span>
<div class="more">
<div class="desc">Returns a unique ID for the element.<br>Typically this function will only be used internally.  It is called automatically when necessary when using the other data() functionality.</div>
<div class="example">
<h3>Example:</h3>
<p>Get the store id of an element.  It is assigned on the data() function call if one hasn't been assigned yet.</p>
<pre>
<code class="javascript">
    $(document.body).click(function(e) {
      var id = jQuery.data(e.target);
      $("span").text(id);
    });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;A div&lt;/div&gt;
  &lt;div&gt;Another&lt;/div&gt;
  &lt;p&gt;The id of this div is &lt;span&gt;?&lt;/span&gt;&lt;/p&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-jQuerydata-elemname">
<span class="fn"><a class="name" href="#link-jQuerydata-elemname">jQuery.data</a>( <span class="arg-type tooltip" title="The Javascript object representation of a DOM Element.">Element</span> <span class="arg-name tooltip" title="DOM element of interest.">elem</span>, <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="Name of the data stored.">name</span> ) returns <span class="type"><span class="tooltip" title="">Any</span></span></span>
<div class="more">
<div class="desc">Returns value at named data store for the element.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Get the data named "blah" stored at for an element.</p>
<pre>
<code class="javascript">

    $("button").click(function(e) {
      var adiv = $("div").get(0);
      var value;

      switch ($("button").index(this)) {
        case 0 :
          value = jQuery.data(adiv, "blah");
          break;
        case 1 :
          jQuery.data(adiv, "blah", "hello");
          value = "Stored!";
          break;
        case 2 :
          jQuery.data(adiv, "blah", 86);
          value = "Stored!";
          break;
        case 3 :
          jQuery.removeData(adiv);
          value = "Removed!";
          break;
      }

      $("span").text("" + value);
    });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;A div&lt;/div&gt;
  &lt;button&gt;Get "blah" from the div&lt;/button&gt;
  &lt;button&gt;Set "blah" to "hello"&lt;/button&gt;

  &lt;button&gt;Set "blah" to 86&lt;/button&gt;
  &lt;button&gt;Remove "blah" from the div&lt;/button&gt;
  &lt;p&gt;The "blah" value of this div is &lt;span&gt;?&lt;/span&gt;&lt;/p&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-jQuerydata-elemnamevalue">
<span class="fn"><a class="name" href="#link-jQuerydata-elemnamevalue">jQuery.data</a>( <span class="arg-type tooltip" title="The Javascript object representation of a DOM Element.">Element</span> <span class="arg-name tooltip" title="DOM element of interest.">elem</span>, <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="Name of the data to store.">name</span>, <span class="arg-type tooltip" title="">Any</span> <span class="arg-name tooltip" title="Value to be stored.">value</span> ) returns <span class="type"><span class="tooltip" title="">Any</span></span></span>
<div class="more">
<div class="desc">Stores the value in the named spot and also returns the value.<br>This function can be useful for attaching data to elements without having to create a new expando.  It also isn't limited to a string.  The value can be any format.<br>
<br>To avoid conflicts in plugins, it is usually effective to store one object using the plugin name and put all the necessary information in that object.<br>
<br>
&lt;code&gt;
  var obj = jQuery.data($("#target").get(0), "pluginname", {});
  obj[...] = ...
&lt;/code&gt;</div>
<div class="example">
<h3>Example:</h3>
<p>Store then retrieve a value from the div element.</p>
<pre>
<code class="javascript">
    var adiv = $("div").get(0);
    jQuery.data(adiv, "test", { first: 16, last: "pizza!" });
    $("span:first").text(jQuery.data(adiv, "test").first);
    $("span:last").text(jQuery.data(adiv, "test").last);

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;
    The values stored were 
    &lt;span&gt;&lt;/span&gt;
    and
    &lt;span&gt;&lt;/span&gt;
  &lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-jQueryeach-objectcallback">
<span class="fn"><a class="name" href="#link-jQueryeach-objectcallback">jQuery.each</a>( <span class="arg-type tooltip" title="A simple Javascript object..">Object</span> <span class="arg-name tooltip" title="The object, or array, to iterate over.">object</span>, <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="The function that will be executed on every object.
<pre>function callback(indexInArray, valueOfElement) {
  var booleanKeepGoing;

  this; // == valueOfElement

  return booleanKeepGoing; // optional, unless false 
                           // and want to stop looping
}
</pre>">callback</span> ) returns <span class="type"><span class="tooltip" title="A simple Javascript object..">Object</span></span></span>
<div class="more">
<div class="desc">A generic iterator function, which can be used to seamlessly iterate over both objects and arrays.<br>This function is not the same as $().each() - which is used to iterate, exclusively, over a jQuery object. This function can be used to iterate over anything.<br>
<br>The callback has two arguments:the key (objects) or index (arrays) as the first, and the value as the second.<br>
<br>If you wish to break the each() loop at a particular iteration you can do so by making your function return false. Other return values are ignored.</div>
<div class="example">
<h3>Example:</h3>
<p>Filters the original array of numbers leaving that are not 5 and have an index greater than 3.  Then it removes all 9s while inverting it.</p>
<pre>
<code class="javascript">

    var arr = [ "one", "two", "three", "four", "five" ];
    var obj = { one:1, two:2, three:3, four:4, five:5 };

    jQuery.each(arr, function() {
      $("#" + this).text("My id is " + this + ".");
      return (this != "four"); // will stop running to skip "five"

    });

    jQuery.each(obj, function(i, val) {
      $("#" + i).append(document.createTextNode(" - " + val));
    });
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div id="one"&gt;&lt;/div&gt;
  &lt;div id="two"&gt;&lt;/div&gt;

  &lt;div id="three"&gt;&lt;/div&gt;
  &lt;div id="four"&gt;&lt;/div&gt;
  &lt;div id="five"&gt;&lt;/div&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Iterates over items in an array, accessing both the current item and its index.</p>
<pre>
<code class="javascript"> $.each( [0,1,2], function(i, n){
   alert( "Item #" + i + ": " + n );
 });</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Iterates over the properties in an object, accessing both the current item and its key.</p>
<pre>
<code class="javascript">$.each( { name: "John", lang: "JS" }, function(i, n){
   alert( "Name: " + i + ", Value: " + n );
 });</code>
</pre>
</div>
</div>
</li>
<li id="link-jQueryextend-object">
<span class="fn"><a class="name" href="#link-jQueryextend-object">jQuery.extend</a>( <span class="arg-type tooltip" title="A simple Javascript object..">Object</span> <span class="arg-name tooltip" title="The object that will be merged into the jQuery object.">object</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Extends the jQuery object itself.<br>Can be used to add functions into the jQuery namespace. See &lt;a href='Core/jQuery.fn.extend'&gt;jQuery.fn.extend&lt;/a&gt; for more information on using this method to add &lt;a href='Plugins/Authoring'&gt;Plugins&lt;/a&gt;.</div>
<div class="example">
<h3>Example:</h3>
<p>Adds two functions into the jQuery namespace.</p>
<pre>
<code class="javascript">jQuery.extend({
  min: function(a, b) { return a &lt; b ? a : b; },
  max: function(a, b) { return a &gt; b ? a : b; }
});</code>
</pre>
<h4>Result:</h4>
<pre>
<code class="html">jQuery.min(2,3); // =&gt; 2
jQuery.max(4,5); // =&gt; 5</code>
</pre>
</div>
</div>
</li>
<li id="link-jQueryextend-targetobject1objectN">
<span class="fn"><a class="name" href="#link-jQueryextend-targetobject1objectN">jQuery.extend</a>( <span class="arg-type tooltip" title="A simple Javascript object..">Object</span> <span class="arg-name tooltip" title="The object to extend.">target</span>, <span class="arg-type tooltip" title="A simple Javascript object..">Object</span> <span class="arg-name tooltip" title="The object that will be merged into the first.">object1</span>, <span class="arg-type tooltip" title="A simple Javascript object..">Object</span> <span class="arg-name tooltip" title="More objects to merge into the first.">objectN</span> ) returns <span class="type"><span class="tooltip" title="A simple Javascript object..">Object</span></span></span>
<div class="more">
<div class="desc">Extend one object with one or more others, returning the original, modified, object.<br>This is a great utility for simple inheritance.</div>
<div class="example">
<h3>Example:</h3>
<p>Merge settings and options, modifying settings.</p>
<pre>
<code class="javascript">var settings = { validate: false, limit: 5, name: "foo" };
var options = { validate: true, name: "bar" };
jQuery.extend(settings, options);</code>
</pre>
<h4>Result:</h4>
<pre>
<code class="html">settings == { validate: true, limit: 5, name: "bar" }</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Merge defaults and options, without modifying the defaults.</p>
<pre>
<code class="javascript">var empty = {}
var defaults = { validate: false, limit: 5, name: "foo" };
var options = { validate: true, name: "bar" };
var settings = $.extend(empty, defaults, options);</code>
</pre>
<h4>Result:</h4>
<pre>
<code class="html">settings == { validate: true, limit: 5, name: "bar" }
empty == { validate: true, limit: 5, name: "bar" }</code>
</pre>
</div>
</div>
</li>
<li id="link-jQueryfnextend-object">
<span class="fn"><a class="name" href="#link-jQueryfnextend-object">jQuery.fn.extend</a>( <span class="arg-type tooltip" title="A simple Javascript object..">Object</span> <span class="arg-name tooltip" title="The object that will be merged into the jQuery object.">object</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Extends the jQuery element set to provide new methods (used to make a typical jQuery plugin).<br>Can be used to add functions into the to add &lt;a href='Plugins/Authoring'&gt;plugin methods (plugins)&lt;/a&gt;. </div>
<div class="example">
<h3>Example:</h3>
<p>Adds two plugin methods.</p>
<pre>
<code class="javascript">jQuery.fn.extend({
  check: function() {
    return this.each(function() { this.checked = true; });
  },
  uncheck: function() {
    return this.each(function() { this.checked = false; });
  }
});</code>
</pre>
<h4>Result:</h4>
<pre>
<code class="html">$("input[@type=checkbox]").check();
$("input[@type=radio]").uncheck();</code>
</pre>
</div>
</div>
</li>
<li id="link-jQueryget-urldatacallback">
<span class="fn"><a class="name" href="#link-jQueryget-urldatacallback">jQuery.get</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="The URL of the page to load.">url</span>, <span class="arg-type tooltip" title="A Javascript object that contains key/value pairs in the form of properties and values.">Map</span> <span class="arg-name tooltip" title="Key/value pairs that will be sent to the server.">data</span>, <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="A function to be executed whenever the data is loaded successfully.

<pre>function (data, textStatus) {
  // data could be xmlDoc, jsonObj, html, text, etc...
  this; // the options for this ajax request
}
</pre>">callback</span> ) returns <span class="type"><span class="tooltip" title="An XMLHttpRequest object (referencing a HTTP request).">XMLHttpRequest</span></span></span>
<div class="more">
<div class="desc">Load a remote page using an HTTP GET request.<br>This is an easy way to send a simple GET request to a server without having to use the more complex $.ajax function. It allows a single callback function to be specified that will be executed when the request is complete (and only if the response has a successful response code). If you need to have both error and success callbacks, you may want to use $.ajax.</div>
<div class="example">
<h3>Example:</h3>
<p>Request the test.php page, but ignore the return results.</p>
<pre>
<code class="javascript"> $.get("test.php");</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Request the test.php page and send some additional data along (while still ignoring the return results).</p>
<pre>
<code class="javascript"> $.get("test.php", { name: "John", time: "2pm" } );</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Alert out the results from requesting test.php (HTML or XML, depending on what was returned).</p>
<pre>
<code class="javascript"> $.get("test.php", function(data){
   alert("Data Loaded: " + data);
 });</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Alert out the results from requesting test.cgi with an additional payload of data (HTML or XML, depending on what was returned).</p>
<pre>
<code class="javascript"> $.get("test.cgi", { name: "John", time: "2pm" },
   function(data){
     alert("Data Loaded: " + data);
   });</code>
</pre>
</div>
</div>
</li>
<li id="link-jQuerygetJSON-urldatacallback">
<span class="fn"><a class="name" href="#link-jQuerygetJSON-urldatacallback">jQuery.getJSON</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="The URL of the page to load.">url</span>, <span class="arg-type tooltip" title="A Javascript object that contains key/value pairs in the form of properties and values.">Map</span> <span class="arg-name tooltip" title="Key/value pairs that will be sent to the server.">data</span>, <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="A function to be executed whenever the data is loaded successfully.

<pre>function (data, textStatus) {
  // data will be a jsonObj
  this; // the options for this ajax request
}
</pre>">callback</span> ) returns <span class="type"><span class="tooltip" title="An XMLHttpRequest object (referencing a HTTP request).">XMLHttpRequest</span></span></span>
<div class="more">
<div class="desc">Load JSON data using an HTTP GET request.<br>As of jQuery 1.2, you can load JSON data located on another domain if you specify a [http://bob.pythonmac.org/archives/2005/12/05/remote-json-jsonp/ JSONP] callback, which can be done like so: "myurl?callback=?". jQuery automatically replaces the ? with the correct method name to call, calling your specified callback.<br>
<br>
Note: Keep in mind, that lines after this function will be executed before callback.</div>
<div class="example">
<h3>Example:</h3>
<p>Loads the four most recent cat pictures from the Flickr JSONP API.</p>
<pre>
<code class="javascript">$.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?tags=cat&amp;tagmode=any&amp;format=json&amp;jsoncallback=?",
        function(data){
          $.each(data.items, function(i,item){
            $("&lt;img/&gt;").attr("src", item.media.m).appendTo("#images");
            if ( i == 3 ) return false;
          });
        });</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div id="images"&gt;&lt;/div&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Load the JSON data from test.js and access a name from the returned JSON data.</p>
<pre>
<code class="javascript"> $.getJSON("test.js", function(json){
   alert("JSON Data: " + json.users[3].name);
 });</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Load the JSON data from test.js, passing along additional data, and access a name from the returned JSON data.</p>
<pre>
<code class="javascript"> $.getJSON("test.js", { name: "John", time: "2pm" }, function(json){
   alert("JSON Data: " + json.users[3].name);
 });</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Alert out the results from requesting test.php (HTML or XML, depending on what was returned).</p>
<pre>
<code class="javascript"> $.getIfModified("test.php", function(data){
   alert("Data Loaded: " + data);
 });</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Alert out the results from requesting test.php with an additional payload of data (HTML or XML, depending on what was returned).</p>
<pre>
<code class="javascript"> $.getIfModified("test.cgi", { name: "John", time: "2pm" },
   function(data){
     alert("Data Loaded: " + data);
   });</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>list the result of a consultation of pages,php in HTML as an array. by Manuel Gonzalez.</p>
<pre>
<code class="javascript">

var id=$("#id").attr("value");
  $.getJSON("pages.php",{id:id},dates);
function dates(datos)
{
	
 $("#list").html("Name:"+datos[1].name+"&lt;br&gt;"+"Last Name:"+datos[1].lastname+"&lt;br&gt;"+"Address:"+datos[1].address);
}

</code>
</pre>
</div>
</div>
</li>
<li id="link-jQuerygetScript-urlcallback">
<span class="fn"><a class="name" href="#link-jQuerygetScript-urlcallback">jQuery.getScript</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="The URL of the page to load.">url</span>, <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="A function to be executed whenever the data is loaded successfully.
<pre>function (data, textStatus) {
  // data should be javascript
  this; // the options for this ajax request
}
</pre>">callback</span> ) returns <span class="type"><span class="tooltip" title="An XMLHttpRequest object (referencing a HTTP request).">XMLHttpRequest</span></span></span>
<div class="more">
<div class="desc">Loads, and executes, a local JavaScript file using an HTTP GET request.<br>Before jQuery 1.2, getScript was only able to load scripts from the same domain as the original page. As of 1.2, you can now load JavaScript files from any domain.<br>
<br>Warning: Safari 2 and older is unable to evaluate scripts in a global context synchronously. If you load functions via getScript, make sure to call them after a delay.</div>
<div class="example">
<h3>Example:</h3>
<p>We load the new [http://jquery.com/plugins/project/color official jQuery Color Animation plugin] dynamically and bind some color animations to occur once the new functionality is loaded.</p>
<pre>
<code class="javascript">$.getScript("http://dev.jquery.com/view/trunk/plugins/color/jquery.color.js", function(){
  $("#go").click(function(){
    $(".block").animate( { backgroundColor: 'pink' }, 1000)
      .animate( { backgroundColor: 'blue' }, 1000);
  });
});</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;button id="go"&gt;&amp;raquo; Run&lt;/button&gt;

&lt;div class="block"&gt;&lt;/div&gt;
</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Load the test.js JavaScript file and execute it.</p>
<pre>
<code class="javascript"> $.getScript("test.js");</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Load the test.js JavaScript file and execute it, displaying an alert message when the execution is complete.</p>
<pre>
<code class="javascript"> $.getScript("test.js", function(){
   alert("Script loaded and executed.");
 });</code>
</pre>
</div>
</div>
</li>
<li id="link-jQuerygrep-arraycallbackinvert">
<span class="fn"><a class="name" href="#link-jQuerygrep-arraycallbackinvert">jQuery.grep</a>( <span class="arg-type tooltip" title="">Array</span> <span class="arg-name tooltip" title="The Array to find items in.">array</span>, <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="The function to process each item against.  The first argument to the function is the list item, and the second argument is the list index.  The function should return a Boolean value.  Optionally, this argument may be a string rather than a function.  If the argument is a string, it is treated as a short &quot;lambda-form&quot; function, with &quot;a&quot; representing the list item and &quot;i&quot; representing the index.  For example, &quot;a > 0&quot; may be passed instead of &quot;function(a){ return a > 0; }&quot;.

<pre>function callback(elementOfArray, indexInArray) {
  var shouldKeepIt;

  this; // unmapped

  return shouldKeepIt;
}
</pre>">callback</span>, <span class="arg-type tooltip" title="true or false.">Boolean</span> <span class="arg-name tooltip" title="If &quot;invert&quot; is false, or not provided, then the function returns an array consisting of all elements for which &quot;callback&quot; returns true.  If &quot;invert&quot; is true, then the function returns an array consisting of all elements for which &quot;callback&quot; returns false.">invert</span> ) returns <span class="type"><span class="tooltip" title="">Array</span></span></span>
<div class="more">
<div class="desc">Filter items out of an array, by using a filter function.<br>The specified function will be passed two arguments: The current array item and the index of the item in the array. The function must return 'true' to keep the item in the array, false to remove it.</div>
<div class="example">
<h3>Example:</h3>
<p>Filters the original array of numbers leaving that are not 5 and have an index greater than 3.  Then it removes all 9s while inverting it.</p>
<pre>
<code class="javascript">

    var arr = [ 1, 9, 3, 8, 6, 1, 5, 9, 4, 7, 3, 8, 6, 9, 1 ];
    $("div").text(arr.join(", "));

    arr = jQuery.grep(arr, function(n, i){
      return (n != 5 &amp;&amp; i &gt; 4);
    });
    $("p").text(arr.join(", "));

    arr = jQuery.grep(arr, "a != 9");
    $("span").text(arr.join(", "));

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;&lt;/div&gt;
  &lt;p&gt;&lt;/p&gt;
  &lt;span&gt;&lt;/span&gt;
  </code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Filter an array of numbers to include only numbers bigger then zero.</p>
<pre>
<code class="javascript">$.grep( [0,1,2], function(n,i){
   return n &gt; 0;
 });</code>
</pre>
<h4>Result:</h4>
<pre>
<code class="html">[1, 2]</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Filter an array of numbers to exclude numbers bigger then zero using the third parameter, invert.</p>
<pre>
<code class="javascript">$.grep( [0,1,2,3,4,5], "a &gt; 1", true);</code>
</pre>
<h4>Result:</h4>
<pre>
<code class="html">[0, 1]</code>
</pre>
</div>
</div>
</li>
<li id="link-jQueryinArray-valuearray">
<span class="fn"><a class="name" href="#link-jQueryinArray-valuearray">jQuery.inArray</a>( <span class="arg-type tooltip" title="">Any</span> <span class="arg-name tooltip" title="Value to see if it exists in the array.">value</span>, <span class="arg-type tooltip" title="">Array</span> <span class="arg-name tooltip" title="Array to look through for the value.">array</span> ) returns <span class="type"><span class="tooltip" title="A valid numeric.">Number</span></span></span>
<div class="more">
<div class="desc">Determine the index of the first parameter in the Array (-1 if not found).<br>
</div>
<div class="example">
<h3>Example:</h3>
<p></p>
<pre>
<code class="javascript">

    var arr = [ 4, "Pete", 8, "John" ];

    $("span:eq(0)").text(jQuery.inArray("John", arr));
    $("span:eq(1)").text(jQuery.inArray(4, arr));
    $("span:eq(2)").text(jQuery.inArray("David", arr));

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;"John" found at &lt;span&gt;&lt;/span&gt;&lt;/div&gt;
  &lt;div&gt;4 found at &lt;span&gt;&lt;/span&gt;&lt;/div&gt;

  &lt;div&gt;"David" found at &lt;span&gt;&lt;/span&gt;&lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-jQueryisFunction-obj">
<span class="fn"><a class="name" href="#link-jQueryisFunction-obj">jQuery.isFunction</a>( <span class="arg-type tooltip" title="A simple Javascript object..">Object</span> <span class="arg-name tooltip" title="Object to test whether or not it is a function.">obj</span> ) returns <span class="type"><span class="tooltip" title="">boolean</span></span></span>
<div class="more">
<div class="desc">Determine if the parameter passed is a function.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Test a few parameter examples.</p>
<pre>
<code class="javascript">

    function stub() {
    }
    var objs = [
          function () {},
          { x:15, y:20 },
          null,
          stub,
          "function"
        ];

    jQuery.each(objs, function (i) {
      var isFunc = jQuery.isFunction(objs[i]);
      $("span:eq( " + i + ")").text(isFunc);
    });
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">
  &lt;div&gt;jQuery.isFunction(objs[0]) = &lt;span&gt;&lt;/span&gt;&lt;/div&gt;

  &lt;div&gt;jQuery.isFunction(objs[1]) = &lt;span&gt;&lt;/span&gt;&lt;/div&gt;
  &lt;div&gt;jQuery.isFunction(objs[2]) = &lt;span&gt;&lt;/span&gt;&lt;/div&gt;
  &lt;div&gt;jQuery.isFunction(objs[3]) = &lt;span&gt;&lt;/span&gt;&lt;/div&gt;

  &lt;div&gt;jQuery.isFunction(objs[4]) = &lt;span&gt;&lt;/span&gt;&lt;/div&gt;
  </code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Finds out if the parameter is a funcion.</p>
<pre>
<code class="javascript">$.isFunction(function(){});</code>
</pre>
<h4>Result:</h4>
<pre>
<code class="html">true</code>
</pre>
</div>
</div>
</li>
<li id="link-jQuerymakeArray-obj">
<span class="fn"><a class="name" href="#link-jQuerymakeArray-obj">jQuery.makeArray</a>( <span class="arg-type tooltip" title="A simple Javascript object..">Object</span> <span class="arg-name tooltip" title="Array-like object to turn in to an actual Array.">obj</span> ) returns <span class="type"><span class="tooltip" title="">Array</span></span></span>
<div class="more">
<div class="desc">Turns an array-like object into a true array.<br>Array-like objects have a length property and its properties are numbered from 0 to length - 1.  Typically it will be unnecessary to use this function if you are using jQuery which uses this function internally.</div>
<div class="example">
<h3>Example:</h3>
<p>Turn a collection of HTMLElements into an Array of them.</p>
<pre>
<code class="javascript">

    var arr = jQuery.makeArray(document.getElementsByTagName("div"));
    arr.reverse(); // use an Array method on list of dom elements
    $(arr).appendTo(document.body);
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;First&lt;/div&gt;
  &lt;div&gt;Second&lt;/div&gt;  
  &lt;div&gt;Third&lt;/div&gt;

  &lt;div&gt;Fourth&lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-jQuerymap-arraycallback">
<span class="fn"><a class="name" href="#link-jQuerymap-arraycallback">jQuery.map</a>( <span class="arg-type tooltip" title="">Array</span> <span class="arg-name tooltip" title="The Array to translate.">array</span>, <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="The function to process each item against.  The argument to the function is the list item. The function can return any value.  Optionally, this argument may be a string rather than a function. If the argument is a string, it is treated as a short &quot;lambda-form&quot; function, with &quot;a&quot; representing the list item. For example, &quot;a * a&quot; may be passed instead of &quot;function(a){ return a * a; }&quot;. 

<pre>function callback(elementOfArray, indexInArray) {
  var replacementValue;

  this; // unmapped

  return replacementValue;
}
</pre>">callback</span> ) returns <span class="type"><span class="tooltip" title="">Array</span></span></span>
<div class="more">
<div class="desc">Translate all items in an array to another array of items.<br>The translation function that is provided to this method is called for each item in the array and is passed one argument: The item to be translated.<br>
<br>The function can then return the translated value, 'null' (to remove the item), or an array of values - which will be flattened into the full array. </div>
<div class="example">
<h3>Example:</h3>
<p>Maps the original array to a new one and adds 4 to each value.</p>
<pre>
<code class="javascript">
    var arr = [ "a", "b", "c", "d", "e" ]
    $("div").text(arr.join(", "));

    arr = jQuery.map(arr, function(n, i){
      return (n.toUpperCase() + i);
    });
    $("p").text(arr.join(", "));

    arr = jQuery.map(arr, "a + a");
    $("span").text(arr.join(", "));

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;&lt;/div&gt;
  &lt;p&gt;&lt;/p&gt;
  &lt;span&gt;&lt;/span&gt;
  </code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Maps the original array to a new one and adds 4 to each value.</p>
<pre>
<code class="javascript">$.map( [0,1,2], function(n){
   return n + 4;
 });</code>
</pre>
<h4>Result:</h4>
<pre>
<code class="html">[4, 5, 6]</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Maps the original array to a new one and adds 1 to each value if it is bigger then zero, otherwise it's removed.</p>
<pre>
<code class="javascript">$.map( [0,1,2], function(n){
   return n &gt; 0 ? n + 1 : null;
 });</code>
</pre>
<h4>Result:</h4>
<pre>
<code class="html">[2, 3]</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Maps the original array to a new one, each element is added with it's original value and the value plus one.</p>
<pre>
<code class="javascript">$.map( [0,1,2], function(n){
   return [ n, n + 1 ];
 });</code>
</pre>
<h4>Result:</h4>
<pre>
<code class="html">[0, 1, 1, 2, 2, 3]</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Maps the original array to a new one, each element is squared.</p>
<pre>
<code class="javascript">$.map( [0,1,2,3], "a * a" );</code>
</pre>
<h4>Result:</h4>
<pre>
<code class="html">[0, 1, 4, 9]</code>
</pre>
</div>
</div>
</li>
<li id="link-jQuerynoConflict-">
<span class="fn"><a class="name" href="#link-jQuerynoConflict-">jQuery.noConflict</a>(  ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Run this function to give control of the $ variable back to whichever library first implemented it.<br>This helps to make sure that jQuery doesn't conflict with the $ object of other libraries.<br>
<br>By using this function, you will only be able to access jQuery using the 'jQuery' variable. For example, where you used to do $("div p"), you now must do jQuery("div p").</div>
<div class="example">
<h3>Example:</h3>
<p>Maps the original object that was referenced by $ back to $.</p>
<pre>
<code class="javascript">jQuery.noConflict();
// Do something with jQuery
jQuery("div p").hide();
// Do something with another library's $()
$("content").style.display = 'none';</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Reverts the $ alias and then creates and executes a function to provide the $ as a jQuery alias inside the functions scope. Inside the function the original $ object is not available. This works well for most plugins that don't rely on any other library.</p>
<pre>
<code class="javascript">jQuery.noConflict();
(function($) { 
  $(function() {
    // more code using $ as alias to jQuery
  });
})(jQuery);
// other code using $ as an alias to the other library</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Creates a different alias instead of jQuery to use in the rest of the script.</p>
<pre>
<code class="javascript">var j = jQuery.noConflict();
// Do something with jQuery
j("div p").hide();
// Do something with another library's $()
$("content").style.display = 'none';</code>
</pre>
</div>
</div>
</li>
<li id="link-jQuerynoConflict-extreme">
<span class="fn"><a class="name" href="#link-jQuerynoConflict-extreme">jQuery.noConflict</a>( <span class="arg-type tooltip" title="true or false.">Boolean</span> <span class="arg-name tooltip" title="Set to true to enable the extreme rollback of jQuery and it's variables.">extreme</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Revert control of both the $ and jQuery variables to their original owners. '''Use with discretion.'''<br>This is a more-extreme version of the simple &lt;a href='Core/jQuery.noConflict'&gt;noConflict&lt;/a&gt; method, as this one will completely undo what jQuery has introduced. This is to be used in an extreme case where you'd like to embed jQuery into a high-conflict environment. '''NOTE:''' It's very likely that plugins won't work after this particular method has been called.</div>
<div class="example">
<h3>Example:</h3>
<p>Completely move jQuery to a new namespace in another object.</p>
<pre>
<code class="javascript">var dom = {};
dom.query = jQuery.noConflict(true);</code>
</pre>
<h4>Result:</h4>
<pre>
<code class="html">// Do something with the new jQuery
dom.query("div p").hide();
// Do something with another library's $()
$("content").style.display = 'none';
// Do something with another version of jQuery
jQuery("div &gt; p").hide();</code>
</pre>
</div>
</div>
</li>
<li id="link-jQueryparam-obj">
<span class="fn"><a class="name" href="#link-jQueryparam-obj">jQuery.param</a>( <span class="arg-type tooltip" title="">Array&lt;Elements&gt;, jQuery, Object</span> <span class="arg-name tooltip" title="An Array or jQuery object is serialized by name/value pairs.  An object by key/value pairs.">obj</span> ) returns <span class="type"><span class="tooltip" title="A string of characters.">String</span></span></span>
<div class="more">
<div class="desc">Serializes an array of form elements or an object (core of &lt;a href='Ajax/serialize'&gt;.serialize()&lt;/a&gt; method).<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Serialize a key/value object.</p>
<pre>
<code class="javascript">
    var params = { width:1680, height:1050 };
    var str = jQuery.param(params);
    $("#results").text(str);

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div id="results"&gt;&lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-jQuerypost-urldatacallback">
<span class="fn"><a class="name" href="#link-jQuerypost-urldatacallback">jQuery.post</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="The URL of the page to load.">url</span>, <span class="arg-type tooltip" title="A Javascript object that contains key/value pairs in the form of properties and values.">Map</span> <span class="arg-name tooltip" title="Key/value pairs that will be sent to the server.">data</span>, <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="A function to be executed whenever the data is loaded successfully.

<pre>function (data, textStatus) {
  // data could be xmlDoc, jsonObj, html, text, etc...
  this; // the options for this ajax request
}
</pre>">callback</span> ) returns <span class="type"><span class="tooltip" title="An XMLHttpRequest object (referencing a HTTP request).">XMLHttpRequest</span></span></span>
<div class="more">
<div class="desc">Load a remote page using an HTTP POST request.<br>This is an easy way to send a simple POST request to a server without having to use the more complex $.ajax function. It allows a single callback function to be specified that will be executed when the request is complete (and only if the response has a successful response code). If you need to have both error and success callbacks, you may want to use $.ajax.</div>
<div class="example">
<h3>Example:</h3>
<p>Request the test.php page, but ignore the return results.</p>
<pre>
<code class="javascript"> $.post("test.php");</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Request the test.php page and send some additional data along (while still ignoring the return results).</p>
<pre>
<code class="javascript"> $.post("test.php", { name: "John", time: "2pm" } );</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Alert out the results from requesting test.php (HTML or XML, depending on what was returned).</p>
<pre>
<code class="javascript"> $.post("test.php", function(data){
   alert("Data Loaded: " + data);
 });</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Alert out the results from requesting test.php with an additional payload of data (HTML or XML, depending on what was returned).</p>
<pre>
<code class="javascript"> $.post("test.cgi", { name: "John", time: "2pm" },
   function(data){
     alert("Data Loaded: " + data);
   });</code>
</pre>
</div>
</div>
</li>
<li id="link-jQueryremoveData-elem">
<span class="fn"><a class="name" href="#link-jQueryremoveData-elem">jQuery.removeData</a>( <span class="arg-type tooltip" title="The Javascript object representation of a DOM Element.">Element</span> <span class="arg-name tooltip" title="Element to delete the data store from.">elem</span> ) returns <span class="type"><span class="tooltip" title=""></span></span></span>
<div class="more">
<div class="desc">Remove the expando attribute that allows data storage on an element.<br>This is the complement function to jQuery.data(elem) which is called as necessary by jQuery.data(elem, name, value).</div>
<div class="example">
<h3>Example:</h3>
<p>Set a data store then remove it.</p>
<pre>
<code class="javascript">

    var adiv = $("div").get(0);

    $("span:eq(0)").text("" + jQuery.data(adiv, "test1"));
    jQuery.data(adiv, "test1", "VALUE-1");
    jQuery.data(adiv, "test2", "VALUE-2");
    $("span:eq(1)").text("" + jQuery.data(adiv, "test1"));
    jQuery.removeData(adiv);
    $("span:eq(2)").text("" + jQuery.data(adiv, "test1"));
    $("span:eq(3)").text("" + jQuery.data(adiv, "test2"));

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;value1 before creation: &lt;span&gt;&lt;/span&gt;&lt;/div&gt;
  &lt;div&gt;value1 after creation: &lt;span&gt;&lt;/span&gt;&lt;/div&gt;
  &lt;div&gt;value1 after removal: &lt;span&gt;&lt;/span&gt;&lt;/div&gt;

  &lt;div&gt;value2 after removal: &lt;span&gt;&lt;/span&gt;&lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-jQueryremoveData-elemname">
<span class="fn"><a class="name" href="#link-jQueryremoveData-elemname">jQuery.removeData</a>( <span class="arg-type tooltip" title="The Javascript object representation of a DOM Element.">Element</span> <span class="arg-name tooltip" title="Element to delete the named data store property from.">elem</span>, <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="The name of the data store property to remove.">name</span> ) returns <span class="type"><span class="tooltip" title=""></span></span></span>
<div class="more">
<div class="desc">Removes just this one named data store.<br>This is the complement function to jQuery.data(elem, name, value).</div>
<div class="example">
<h3>Example:</h3>
<p>Set a data store for 2 names then remove one of them.</p>
<pre>
<code class="javascript">
    var adiv = $("div").get(0);

    $("span:eq(0)").text("" + jQuery.data(adiv, "test1"));
    jQuery.data(adiv, "test1", "VALUE-1");
    jQuery.data(adiv, "test2", "VALUE-2");
    $("span:eq(1)").text("" + jQuery.data(adiv, "test1"));
    jQuery.removeData(adiv, "test1");
    $("span:eq(2)").text("" + jQuery.data(adiv, "test1"));
    $("span:eq(3)").text("" + jQuery.data(adiv, "test2"));

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;value1 before creation: &lt;span&gt;&lt;/span&gt;&lt;/div&gt;
  &lt;div&gt;value1 after creation: &lt;span&gt;&lt;/span&gt;&lt;/div&gt;
  &lt;div&gt;value1 after removal: &lt;span&gt;&lt;/span&gt;&lt;/div&gt;

  &lt;div&gt;value2 after removal: &lt;span&gt;&lt;/span&gt;&lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-jQuerytrim-str">
<span class="fn"><a class="name" href="#link-jQuerytrim-str">jQuery.trim</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="The string to trim.">str</span> ) returns <span class="type"><span class="tooltip" title="A string of characters.">String</span></span></span>
<div class="more">
<div class="desc">Remove the whitespace from the beginning and end of a string.<br>Uses a regular expression to remove whitespace from the given string.</div>
<div class="example">
<h3>Example:</h3>
<p>Removes the two whitespaces at the start and at the end of the string.</p>
<pre>
<code class="javascript">

    $("button").click(function () {
      var str = "     lots of spaces before and after     ";
      alert("'" + str + "'");

      str = jQuery.trim(str);
      alert("'" + str + "' - no longer");
    });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;button&gt;Show Trim Example&lt;/button&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Removes the two whitespaces at the start and at the end of the string.</p>
<pre>
<code class="javascript"> $.trim("  hello, how are you?  ");</code>
</pre>
<h4>Result:</h4>
<pre>
<code class="html">"hello, how are you?"</code>
</pre>
</div>
</div>
</li>
<li id="link-jQueryunique-array">
<span class="fn"><a class="name" href="#link-jQueryunique-array">jQuery.unique</a>( <span class="arg-type tooltip" title="">Array</span> <span class="arg-name tooltip" title="The Array to translate.">array</span> ) returns <span class="type"><span class="tooltip" title="">Array</span></span></span>
<div class="more">
<div class="desc">Remove all duplicate elements from an array of elements.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Removes any duplicate elements from the array of divs.</p>
<pre>
<code class="javascript">
    var divs = $("div").get();

    // add 3 elements of class dup too (they are divs)
    divs = divs.concat($(".dup").get());
    $("div:eq(1)").text("Pre-unique there are " + divs.length + " elements.");

    divs = jQuery.unique(divs);
    $("div:eq(2)").text("Post-unique there are " + divs.length + " elements.")
                  .css("color", "red");

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;There are 6 divs in this document.&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div class="dup"&gt;&lt;/div&gt;
  &lt;div class="dup"&gt;&lt;/div&gt;

  &lt;div class="dup"&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Removes any duplicate elements from the array of divs.</p>
<pre>
<code class="javascript">$.unique(document.getElementsByTagName("div"));</code>
</pre>
<h4>Result:</h4>
<pre>
<code class="html">[&lt;div&gt;, &lt;div&gt;, ...]</code>
</pre>
</div>
</div>
</li>
<li id="link-keydown-">
<span class="fn"><a class="name" href="#link-keydown-">keydown</a>(  ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Triggers the keydown event of each matched element.<br>This causes all of the functions that have been bound to the keydown event to be executed, and calls the browser's default keydown action on the matching element(s). This default action can be prevented by returning false from one of the functions bound to the keydown event. The keydown event usually fires when a key on the keyboard is pressed.</div>
</div>
</li>
<li id="link-keydown-fn">
<span class="fn"><a class="name" href="#link-keydown-fn">keydown</a>( <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="A function to bind to the keydown event on each of the matched elements.
<pre>function callback(eventObject) {
  this; // dom element
}
</pre>">fn</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Bind a function to the keydown event of each matched element.<br>The keydown event fires when a key on the keyboard is pressed.</div>
<div class="example">
<h3>Example:</h3>
<p>To perform actions in response to keyboard presses on a page, try:</p>
<pre>
<code class="javascript">$(window).keydown(function(event){
  switch (event.keyCode) {
    // ...
    // different keys do different things
    // Different browsers provide different codes
    // see here for details: http://unixpapa.com/js/key.html    
    // ...
  }
});</code>
</pre>
</div>
</div>
</li>
<li id="link-keypress-">
<span class="fn"><a class="name" href="#link-keypress-">keypress</a>(  ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Triggers the keypress event of each matched element.<br>This causes all of the functions that have been bound to the keypress event to be executed, and calls the browser's default keypress action on the matching element(s). This default action can be prevented by returning false from one of the functions bound to the keypress event. The keypress event usually fires when a key on the keyboard is pressed.<br>
<br>
</div>
</div>
</li>
<li id="link-keypress-fn">
<span class="fn"><a class="name" href="#link-keypress-fn">keypress</a>( <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="A function to bind to the keypress event on each of the matched elements.
<pre>function callback(eventObject) {
  this; // dom element
}

</pre>">fn</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Binds a function to the keypress event of each matched element.<br>The keypress event fires when a key on the keyboard is "clicked". A keypress is defined as a keydown and keyup on the same key. The sequence of these events is: &lt;ul&gt;&lt;li&gt;keydown&lt;/li&gt;&lt;li&gt;keyup&lt;/li&gt;&lt;li&gt;keypress&lt;/li&gt;&lt;/ul&gt;</div>
<div class="example">
<h3>Example:</h3>
<p>Show spaces and letters when typed.</p>
<pre>
<code class="javascript">
    $("input").keypress(function (e) {
      if (e.which == 32 || (65 &lt;= e.which &amp;&amp; e.which &lt;= 65 + 25)
                        || (97 &lt;= e.which &amp;&amp; e.which &lt;= 97 + 25)) {
        var c = String.fromCharCode(e.which);
        $("p").append($("&lt;span/&gt;"))
              .children(":last")
              .append(document.createTextNode(c));
      } else if (e.which == 8) {
        // backspace in IE only be on keydown
        $("p").children(":last").remove();
      }
      $("div").text(e.which);
    });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;input type="text" /&gt;
  &lt;p&gt;Add text - &lt;/p&gt;
  &lt;div&gt;&lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-keyup-">
<span class="fn"><a class="name" href="#link-keyup-">keyup</a>(  ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Triggers the keyup event of each matched element.<br>This causes all of the functions that have been bound to the keyup event to be executed, and calls the browser's default keyup action on the matching element(s). This default action can be prevented by returning false from one of the functions bound to the keyup event. The keyup event usually fires when a key on the keyboard is released.</div>
</div>
</li>
<li id="link-keyup-fn">
<span class="fn"><a class="name" href="#link-keyup-fn">keyup</a>( <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="A function to bind to the keyup event on each of the matched elements.

<pre>function callback(eventObject) {
  this; // dom element
}
</pre>">fn</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Bind a function to the keyup event of each matched element.<br>The keyup event fires when a key on the keyboard is released.</div>
<div class="example">
<h3>Example:</h3>
<p>To perform an action when the escape key has been released:</p>
<pre>
<code class="javascript">$(document).keyup(function(event){
    if (event.keyCode == 27) {
        alert('escaped!');
    }
});</code>
</pre>
</div>
</div>
</li>
<li id="link-last-">
<span class="fn"><a class="name" href="#link-last-">last</a>(  ) returns <span class="type"><span class="tooltip" title="The Javascript object representation of a DOM Element.">Element</span></span></span>
<div class="more">
<div class="desc">Matches the last selected element.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Finds the last table row.</p>
<pre>
<code class="javascript">$("tr:last").css({backgroundColor: 'yellow', fontWeight: 'bolder'});</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;table&gt;

    &lt;tr&gt;&lt;td&gt;First Row&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;Middle Row&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;Last Row&lt;/td&gt;&lt;/tr&gt;

  &lt;/table&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-lastChild-">
<span class="fn"><a class="name" href="#link-lastChild-">lastChild</a>(  ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Matches the last child of its parent.<br>While &lt;a href='Selectors/last'&gt;:last&lt;/a&gt; matches only a single element, this matches more then one: One for each parent.</div>
<div class="example">
<h3>Example:</h3>
<p>Finds the last span in each matched div and adds some css plus a hover state.</p>
<pre>
<code class="javascript">
    $("div span:last-child")
        .css({color:"red", fontSize:"80%"})
        .hover(function () {
              $(this).addClass("solast");
            }, function () {
              $(this).removeClass("solast");
            });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;
    &lt;span&gt;John,&lt;/span&gt;
    &lt;span&gt;Karl,&lt;/span&gt;
    &lt;span&gt;Brandon,&lt;/span&gt;

    &lt;span&gt;Sam&lt;/span&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;span&gt;Glen,&lt;/span&gt;
    &lt;span&gt;Tane,&lt;/span&gt;

    &lt;span&gt;Ralph,&lt;/span&gt;
    &lt;span&gt;David&lt;/span&gt;
  &lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-length-">
<span class="fn"><a class="name" href="#link-length-">length</a> returns <span class="type"><span class="tooltip" title="A valid numeric.">Number</span></span></span>
<div class="more">
<div class="desc">The number of elements in the jQuery object.<br>In a The number of elements currently matched. The &lt;a href='Core/size'&gt;size&lt;/a&gt; function will return the same value.</div>
<div class="example">
<h3>Example:</h3>
<p>Count the divs.  Click to add more.</p>
<pre>
<code class="javascript"> 
    $(document.body).click(function () {
      $(document.body).append($("&lt;div&gt;"));
      var n = $("div").length;
      $("span").text("There are " + n + " divs." +
                     "Click to add more.");
    }).trigger('click'); // trigger the click to start

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;span&gt;&lt;/span&gt;
  &lt;div&gt;&lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-load-urldatacallback">
<span class="fn"><a class="name" href="#link-load-urldatacallback">load</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="The URL of the HTML page to load.">url</span>, <span class="arg-type tooltip" title="A Javascript object that contains key/value pairs in the form of properties and values.">Map</span> <span class="arg-name tooltip" title="Key/value pairs that will be sent to the server.">data</span>, <span class="arg-type tooltip" title="">Callback</span> <span class="arg-name tooltip" title="The function called when the ajax request is complete (not necessarily success).

<pre>function (responseText, textStatus, XMLHttpRequest) {
  this; // dom element
}
</pre>">callback</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Load HTML from a remote file and inject it into the DOM.<br>A GET request will be performed by default - but if you pass in any extra parameters then a POST will occur.<br>
<br>In jQuery 1.2 you can now specify a jQuery selector in the URL. Doing so will filter the incoming HTML document, only injecting the elements that match the selector. The syntax looks something like "url #some &gt; selector". See the examples for more information.</div>
<div class="example">
<h3>Example:</h3>
<p>Load a piece of the documentation sidebar navigation into a custom unordered list.</p>
<pre>
<code class="javascript">$("#links").load("/Main_Page #p-Getting-Started li");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;b&gt;jQuery Links:&lt;/b&gt;
&lt;ul id="links"&gt;&lt;/ul&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Load the feeds.html file into the div with the ID of feeds.</p>
<pre>
<code class="javascript">$("#feeds").load("feeds.html");</code>
</pre>
<h4>Result:</h4>
<pre>
<code class="html">&lt;div id="feeds"&gt;&lt;b&gt;45&lt;/b&gt; feeds found.&lt;/div&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Same as above, but will POST the additional parameters to the server and a callback that is executed when the server is finished responding.</p>
<pre>
<code class="javascript"> $("#feeds").load("feeds.php", {limit: 25}, function(){
   alert("The last 25 entries in the feed have been loaded");
 });</code>
</pre>
</div>
</div>
</li>
<li id="link-load -fn">
<span class="fn"><a class="name" href="#link-load -fn">load </a>( <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="A function to bind to the load event on each of the matched elements.
<pre>function callback(eventObject) {
  this; // dom element
}
</pre>">fn</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Binds a function to the load event of each matched element.<br>When bound to the window element, the event fires when the user agent finishes loading all content within a document, including window, frames, objects and images. For elements, it fires when the target element and all of its content has finished loading.</div>
<div class="example">
<h3>Example:</h3>
<p>Run a function when the page is fully loaded including graphics.</p>
<pre>
<code class="javascript">
    $(window).load(function () {
      // run code
    });
</code>
</pre>
</div>
</div>
</li>
<li id="link-lt-index">
<span class="fn"><a class="name" href="#link-lt-index">lt</a>( <span class="arg-type tooltip" title="A valid numeric.">Number</span> <span class="arg-name tooltip" title="Zero-based index.">index</span> ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Matches all elements with an index below the given one.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Finds TDs less than the one with the 4th index (TD#4).</p>
<pre>
<code class="javascript">$("td:lt(4)").css("color", "red");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;table border="1"&gt;

    &lt;tr&gt;&lt;td&gt;TD #0&lt;/td&gt;&lt;td&gt;TD #1&lt;/td&gt;&lt;td&gt;TD #2&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;TD #3&lt;/td&gt;&lt;td&gt;TD #4&lt;/td&gt;&lt;td&gt;TD #5&lt;/td&gt;&lt;/tr&gt;

    &lt;tr&gt;&lt;td&gt;TD #6&lt;/td&gt;&lt;td&gt;TD #7&lt;/td&gt;&lt;td&gt;TD #8&lt;/td&gt;&lt;/tr&gt;
  &lt;/table&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-map-callback">
<span class="fn"><a class="name" href="#link-map-callback">map</a>( <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="The function to execute on each element in the set.
<pre>function callback(index, domElement) {
  var replacement;

  this; // also dom element

  // replacement == null : delete spot
  // replacement == array : insert the elements of the array
  // else replace the spot with replacement
  return replacement;
}
</pre>">callback</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Translate a set of elements in the jQuery object into another set of values in an array (which may, or may not, be elements).<br>You could use this to build lists of values, attributes, css values - or even perform special, custom, selector transformations.<br>
<br>This is provided as a convenience method for using &lt;a href='Utilities/jQuery.map'&gt;$.map()&lt;/a&gt;.</div>
<div class="example">
<h3>Example:</h3>
<p>Build a list of all the values within a form.</p>
<pre>
<code class="javascript">
    $("p").append( $("input").map(function(){
      return $(this).val();
    }).get().join(", ") );

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;&lt;b&gt;Values: &lt;/b&gt;&lt;/p&gt;
  &lt;form&gt;
    &lt;input type="text" name="name" value="John"/&gt;

    &lt;input type="text" name="password" value="password"/&gt;
    &lt;input type="text" name="url" value="http://ejohn.org/"/&gt;

  &lt;/form&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>A contrived example to show some functionality.</p>
<pre>
<code class="javascript">
    var mappedItems = $("li").map(function (index) {
      var replacement = $("&lt;li&gt;").text($(this).text()).get(0);
      if (index == 0) {
        // make the first item all caps
        $(replacement).text($(replacement).text().toUpperCase());
      } else if (index == 1 || index == 3) {
        // delete the second and fourth items
        replacement = null;
      } else if (index == 2) {
        // make two of the third item and add some text
        replacement = [replacement,$("&lt;li&gt;").get(0)];
        $(replacement[0]).append("&lt;b&gt; - A&lt;/b&gt;");
        $(replacement[1]).append("Extra &lt;b&gt; - B&lt;/b&gt;");
      }

      // replacment will be an dom element, null, 
      // or an array of dom elements
      return replacement;
    });
    $("#results").append(mappedItems);

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;ul&gt;
    &lt;li&gt;First&lt;/li&gt;
    &lt;li&gt;Second&lt;/li&gt;
    &lt;li&gt;Third&lt;/li&gt;

    &lt;li&gt;Fourth&lt;/li&gt;
    &lt;li&gt;Fifth&lt;/li&gt;
  &lt;/ul&gt;
  &lt;ul id="results"&gt;

  &lt;/ul&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-mousedown -fn">
<span class="fn"><a class="name" href="#link-mousedown -fn">mousedown </a>( <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="A function to bind to the mousedown event on each of the matched elements.

<pre>function callback(eventObject) {
  this; // dom element
}
</pre>">fn</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Binds a function to the mousedown event of each matched element.<br>The mousedown event fires when the pointing device button is pressed over an element.</div>
</div>
</li>
<li id="link-mousemove-fn">
<span class="fn"><a class="name" href="#link-mousemove-fn">mousemove</a>( <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="A function to bind to the mousmove event on each of the matched elements.
<pre>function callback(eventObject) {
  this; // dom element
}
</pre>">fn</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Bind a function to the mousemove event of each matched element.<br>The mousemove event fires when the pointing device is moved while it is over an element. The event handler is passed one variable - the event object. Its .clientX and .clientY properties represent the coordinates of the mouse.</div>
<div class="example">
<h3>Example:</h3>
<p>Show the mouse coordinates when the mouse is moved over the yellow div.  Coordinates are relative to the window which in this case is the iframe.</p>
<pre>
<code class="javascript">
    $("div").mousemove(function(e){
      var pageCoords = "( " + e.pageX + ", " + e.pageY + " )";
      var clientCoords = "( " + e.clientX + ", " + e.clientY + " )";
      $("span:first").text("( e.pageX, e.pageY ) - " + pageCoords);
      $("span:last").text("( e.clientX, e.clientY ) - " + clientCoords);
    });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;   
    Try scrolling too.
    &lt;span&gt;Move the mouse over the div.&lt;/span&gt;
    &lt;span&gt;&amp;nbsp;&lt;/span&gt;
  &lt;/p&gt;

  &lt;div&gt;&lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-mouseout-fn">
<span class="fn"><a class="name" href="#link-mouseout-fn">mouseout</a>( <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="A function to bind to the mouseout event on each of the matched elements.
<pre>function callback(eventObject) {
  this; // dom element
}
</pre>">fn</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Bind a function to the mouseout event of each matched element.<br>The mouseout event fires when the pointing device is moved away from an element.</div>
</div>
</li>
<li id="link-mouseover-fn">
<span class="fn"><a class="name" href="#link-mouseover-fn">mouseover</a>( <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="A function to bind to the mouseover event on each of the matched elements.
<pre>function callback(eventObject) {
  this; // dom element
}
</pre>">fn</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Bind a function to the mouseover event of each matched element.<br>The mouseout event fires when the pointing device is moved onto an element.</div>
</div>
</li>
<li id="link-mouseup-fn">
<span class="fn"><a class="name" href="#link-mouseup-fn">mouseup</a>( <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="A function to bind to the mouseup event on each of the matched elements.

<pre>function callback(eventObject) {
  this; // dom element
}
</pre>">fn</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Bind a function to the mouseup event of each matched element.<br>The mouseup event fires when the pointing device button is released over an element.</div>
</div>
</li>
<li id="link-multiple-selector1selector2selectorN">
<span class="fn"><a class="name" href="#link-multiple-selector1selector2selectorN">multiple</a>( <span class="arg-type tooltip" title="">Selector</span> <span class="arg-name tooltip" title="Any valid selector">selector1</span>, <span class="arg-type tooltip" title="">Selector</span> <span class="arg-name tooltip" title="Another valid selector">selector2</span>, <span class="arg-type tooltip" title="">Selector</span> <span class="arg-name tooltip" title="As many more valid selectors as you like">selectorN</span> ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Matches the combined results of all the specified selectors.<br>You can specify any number of selectors to combine into a single result.  Note order of the dom elements in the jQuery object aren't necessarily identical.</div>
<div class="example">
<h3>Example:</h3>
<p>Finds the elements that match any of these three selectors.</p>
<pre>
<code class="javascript">$("div,span,p.myClass").css("border","3px solid red");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;div&lt;/div&gt;

  &lt;p class="myClass"&gt;p class="myClass"&lt;/p&gt;
  &lt;p class="notMyClass"&gt;p class="notMyClass"&lt;/p&gt;
  &lt;span&gt;span&lt;/span&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Show the order in the jQuery object.</p>
<pre>
<code class="javascript">
    var list = $("div,p,span").map(function () {
      return this.tagName;
    }).get().join(", ");
    $("b").append(document.createTextNode(list));
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;span&gt;span&lt;/span&gt;

  &lt;p&gt;p&lt;/p&gt;
  &lt;p&gt;p&lt;/p&gt;
  &lt;div&gt;div&lt;/div&gt;
  &lt;span&gt;span&lt;/span&gt;

  &lt;p&gt;p&lt;/p&gt;
  &lt;div&gt;div&lt;/div&gt;
  &lt;b&gt;&lt;/b&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-next-expr">
<span class="fn"><a class="name" href="#link-next-expr">next</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="An expression with which to filter the returned set.">expr</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Get a set of elements containing the unique next siblings of each of the given set of elements.<br>next only returns the very next sibling for each element, not all next siblings (see nextAll).<br>
<br>You may provide an optional expression to filter the returned set. </div>
<div class="example">
<h3>Example:</h3>
<p>Find the very next sibling of each disabled button and change its text "this button is disabled".</p>
<pre>
<code class="javascript">$("button[disabled]").next().text("this button is disabled");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;&lt;button disabled="disabled"&gt;First&lt;/button&gt; - &lt;span&gt;&lt;/span&gt;&lt;/div&gt;
  &lt;div&gt;&lt;button&gt;Second&lt;/button&gt; - &lt;span&gt;&lt;/span&gt;&lt;/div&gt;

  &lt;div&gt;&lt;button disabled="disabled"&gt;Third&lt;/button&gt; - &lt;span&gt;&lt;/span&gt;&lt;/div&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Find the very next sibling of each paragraph that has a class "selected".</p>
<pre>
<code class="javascript">$("p").next(".selected").css("background", "yellow");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;Hello&lt;/p&gt;

  &lt;p class="selected"&gt;Hello Again&lt;/p&gt;
  &lt;div&gt;&lt;span&gt;And Again&lt;/span&gt;&lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-next-prevnext">
<span class="fn"><a class="name" href="#link-next-prevnext">next</a>( <span class="arg-type tooltip" title="">Selector</span> <span class="arg-name tooltip" title="Any valid selector.">prev</span>, <span class="arg-type tooltip" title="">Selector</span> <span class="arg-name tooltip" title="A selector to match elements that are next to the first selector.">next</span> ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Matches all next elements specified by "next" that are next to elements specified by "prev".<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Finds all inputs that are next to a label.</p>
<pre>
<code class="javascript">$("label + input").css("color", "blue").val("Labeled!")</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;form&gt;

    &lt;label&gt;Name:&lt;/label&gt;
    &lt;input name="name" /&gt;
    &lt;fieldset&gt;
      &lt;label&gt;Newsletter:&lt;/label&gt;

      &lt;input name="newsletter" /&gt;
    &lt;/fieldset&gt;
  &lt;/form&gt;
  &lt;input name="none" /&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-nextAll-expr">
<span class="fn"><a class="name" href="#link-nextAll-expr">nextAll</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="An expression to filter the next Elements with.">expr</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Find all sibling elements after the current element.<br>Use an optional expression to filter the matched set. </div>
<div class="example">
<h3>Example:</h3>
<p>Locate all the divs after the first and give them a class.</p>
<pre>
<code class="javascript">$("div:first").nextAll().addClass("after");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Locate all the paragraphs after the second child in the body and give them a class.</p>
<pre>
<code class="javascript">

    $(":nth-child(1)").nextAll("p").addClass("after");
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;p&lt;/p&gt;
  &lt;div&gt;div&lt;/div&gt;

  &lt;p&gt;p&lt;/p&gt;
  &lt;p&gt;p&lt;/p&gt;
  &lt;div&gt;div&lt;/div&gt;
  &lt;p&gt;p&lt;/p&gt;

  &lt;div&gt;div&lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-not-selector">
<span class="fn"><a class="name" href="#link-not-selector">not</a>( <span class="arg-type tooltip" title="">Selector</span> <span class="arg-name tooltip" title="A selector with which to filter by.">selector</span> ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Filters out all elements matching the given selector.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Finds all inputs that are not checked and hilites the next sibling span.  Notice there is no change when clicking the checkboxes since no click events have been linked.</p>
<pre>
<code class="javascript">
    $("input:not(:checked) + span").css("background-color", "yellow");
    $("input").attr("disabled", "disabled");

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;
    &lt;input type="checkbox" name="a" /&gt;
    &lt;span&gt;Mary&lt;/span&gt;
  &lt;/div&gt;

  &lt;div&gt;
    &lt;input type="checkbox" name="b" /&gt;
    &lt;span&gt;Paul&lt;/span&gt;

  &lt;/div&gt;
  &lt;div&gt;
    &lt;input type="checkbox" name="c" checked="checked" /&gt;

    &lt;span&gt;Peter&lt;/span&gt;
  &lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-not-expr">
<span class="fn"><a class="name" href="#link-not-expr">not</a>( <span class="arg-type tooltip" title="">String, DOMElement, Array&lt;DOMElement&gt;</span> <span class="arg-name tooltip" title="An expression with which to remove matching elements, an element to remove from the set or a set of elements to remove from the jQuery set of matched elements.">expr</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Removes elements matching the specified expression from the set of matched elements.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Adds a border to divs that are not green or blue.</p>
<pre>
<code class="javascript">
    $("div").not(".green, #blueone")
            .css("border-color", "red");

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;&lt;/div&gt;
  &lt;div id="blueone"&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div class="green"&gt;&lt;/div&gt;

  &lt;div class="green"&gt;&lt;/div&gt;
  &lt;div class="gray"&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Removes the element with the ID "selected" from the set of all paragraphs.</p>
<pre>
<code class="javascript">$("p").not( $("#selected")[0] )</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Removes the element with the ID "selected" from the set of all paragraphs.</p>
<pre>
<code class="javascript">$("p").not("#selected")</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Removes all elements that match "div p.selected" from the total set of all paragraphs.</p>
<pre>
<code class="javascript">$("p").not($("div p.selected"))</code>
</pre>
</div>
</div>
</li>
<li id="link-nthChild-index">
<span class="fn"><a class="name" href="#link-nthChild-index">nthChild</a>( <span class="arg-type tooltip" title="">Number/String</span> <span class="arg-name tooltip" title="The index of each child to match, starting with 1 or the string even, odd, or equation ( eg. :nth-child(even), :nth-child(4n) )">index</span> ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Matches the nth-child of its parent or all its even or odd children.<br>While &lt;a href='Selectors/eq'&gt;:eq(index)&lt;/a&gt; matches only a single element, this matches more then one: One for each parent with index.  Multiple for each parent with even, odd, or equation.<br>
<br>The specified index is one-indexed, in contrast to :eq() which starts at zero.</div>
<div class="example">
<h3>Example:</h3>
<p>Finds the second li in each matched ul and notes it.</p>
<pre>
<code class="javascript">$("ul li:nth-child(2)").append("&lt;span&gt; - 2nd!&lt;/span&gt;");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;&lt;ul&gt;
    &lt;li&gt;John&lt;/li&gt;
    &lt;li&gt;Karl&lt;/li&gt;
    &lt;li&gt;Brandon&lt;/li&gt;

  &lt;/ul&gt;&lt;/div&gt;
  &lt;div&gt;&lt;ul&gt;
    &lt;li&gt;Sam&lt;/li&gt;
  &lt;/ul&gt;&lt;/div&gt;

  &lt;div&gt;&lt;ul&gt;
    &lt;li&gt;Glen&lt;/li&gt;
    &lt;li&gt;Tane&lt;/li&gt;
    &lt;li&gt;Ralph&lt;/li&gt;

    &lt;li&gt;David&lt;/li&gt;
  &lt;/ul&gt;&lt;/div&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>This is a playground to see how the selector works with different strings.  Notice that this is different from the :even and :odd which have no regard for parent and just filter the list of elements to every other one.  The :nth-child, however, counts the index of the child to its particular parent.  In any case, it's easier to see than explain so...</p>
<pre>
<code class="javascript">
    $("button").click(function () {
      var str = $(this).text();
      $("tr").css("background", "white");
      $("tr" + str).css("background", "#e2e1fb");
      $("#inner").text(str);
    });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;
    &lt;button&gt;:nth-child(even)&lt;/button&gt;
    &lt;button&gt;:nth-child(odd)&lt;/button&gt;
    &lt;button&gt;:nth-child(3n)&lt;/button&gt;

    &lt;button&gt;:nth-child(2)&lt;/button&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;button&gt;:nth-child(3n+1)&lt;/button&gt;
    &lt;button&gt;:nth-child(3n+2)&lt;/button&gt;

    &lt;button&gt;:even&lt;/button&gt;
    &lt;button&gt;:odd&lt;/button&gt;
  &lt;/div&gt;
  &lt;div&gt;&lt;table&gt;

    &lt;tr&gt;&lt;td&gt;John&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;Karl&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;Brandon&lt;/td&gt;&lt;/tr&gt;

    &lt;tr&gt;&lt;td&gt;Benjamin&lt;/td&gt;&lt;/tr&gt;
  &lt;/table&gt;&lt;/div&gt;
  &lt;div&gt;&lt;table&gt;
    &lt;tr&gt;&lt;td&gt;Sam&lt;/td&gt;&lt;/tr&gt;

  &lt;/table&gt;&lt;/div&gt;
  &lt;div&gt;&lt;table&gt;
    &lt;tr&gt;&lt;td&gt;Glen&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;Tane&lt;/td&gt;&lt;/tr&gt;

    &lt;tr&gt;&lt;td&gt;Ralph&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;David&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;Mike&lt;/td&gt;&lt;/tr&gt;

    &lt;tr&gt;&lt;td&gt;Dan&lt;/td&gt;&lt;/tr&gt;
  &lt;/table&gt;&lt;/div&gt;
  &lt;span&gt;
    tr&lt;span id="inner"&gt;&lt;/span&gt;

  &lt;/span&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-odd-">
<span class="fn"><a class="name" href="#link-odd-">odd</a>(  ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Matches odd elements, zero-indexed.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Finds odd table rows, matching the second, fourth and so on (index 1, 3, 5 etc.).</p>
<pre>
<code class="javascript">$("tr:odd").css("background-color", "#bbbbff");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;table border="1"&gt;
    &lt;tr&gt;&lt;td&gt;Row with Index #0&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;Row with Index #1&lt;/td&gt;&lt;/tr&gt;

    &lt;tr&gt;&lt;td&gt;Row with Index #2&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;Row with Index #3&lt;/td&gt;&lt;/tr&gt;
  &lt;/table&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-offset-">
<span class="fn"><a class="name" href="#link-offset-">offset</a>(  ) returns <span class="type"><span class="tooltip" title="">Object{top,left}</span></span></span>
<div class="more">
<div class="desc">Get the current offset of the first matched element relative to the viewport.<br>The returned object contains two &lt;a href='Types#Integer'&gt;Integer&lt;/a&gt; properties, top and left. The method works only with visible elements. </div>
<div class="example">
<h3>Example:</h3>
<p>Access the offset of the second paragraph:</p>
<pre>
<code class="javascript">var p = $("p:last");
var offset = p.offset();
p.html( "left: " + offset.left + ", top: " + offset.top );</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;Hello&lt;/p&gt;&lt;p&gt;2nd Paragraph&lt;/p&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Click to see the offset.</p>
<pre>
<code class="javascript">
    $("*", document.body).click(function (e) {
      var offset = $(this).offset();
      e.stopPropagation();
      $("#result").text(this.tagName + " coords ( " + offset.left + ", " +
                                      offset.top + " )");
    });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div id="result"&gt;Click an element.&lt;/div&gt;
  &lt;p&gt;
    This is the best way to &lt;span&gt;find&lt;/span&gt; an offset.
  &lt;/p&gt;

  &lt;div class="abs"&gt;
  &lt;/dov&gt;
  </code>
</pre>
</div>
</div>
</li>
<li id="link-one-typedatafn">
<span class="fn"><a class="name" href="#link-one-typedatafn">one</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="An event type">type</span>, <span class="arg-type tooltip" title="A simple Javascript object..">Object</span> <span class="arg-name tooltip" title="Additional data passed to the event handler as event.data">data</span>, <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="A function to bind to the specified event on each of the matched elements.

<pre>function callback(eventObject) {
  this; // dom element
}
</pre>">fn</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Binds a handler to a particular event to be executed &lt;i&gt;once&lt;/i&gt; for each matched element.<br>&lt;p&gt;The handler is executed only once for each element. Otherwise, the same rules as described in &lt;a href='Events/bind'&gt;bind&lt;/a&gt;() apply. The event handler is passed an event object that you can use to prevent default behaviour. To stop both default action and event bubbling, your handler should return false.&lt;/p&gt;&lt;p&gt;In most cases, you can define your event handlers as anonymous functions (see first example). In cases where that is not possible, you can pass additional data as the second paramter (and the handler function as the third), see second example.&lt;/p&gt;</div>
<div class="example">
<h3>Example:</h3>
<p>Tie a one-time click to each div.</p>
<pre>
<code class="javascript">
    var n = 0;
    $("div").one("click", function(){
      var index = $("div").index(this);
      $(this).css({ borderStyle:"inset",
                    cursor:"auto" });
      $("p").text("Div at index #" + index + " clicked." +
                  "  That's " + ++n + " total clicks.");
    });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;

  &lt;div&gt;&lt;/div&gt;
  &lt;p&gt;Click a green square...&lt;/p&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>To display the text of all paragraphs in an alert box the first time each of them is clicked:</p>
<pre>
<code class="javascript">$("p").one("click", function(){
  alert( $(this).text() );
});</code>
</pre>
</div>
</div>
</li>
<li id="link-onlyChild-">
<span class="fn"><a class="name" href="#link-onlyChild-">onlyChild</a>(  ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Matches the only child of its parent.<br>If the parent has other child elements, nothing is matched.</div>
<div class="example">
<h3>Example:</h3>
<p>Finds the button with no siblings in each matched div and modifies look.</p>
<pre>
<code class="javascript">$("div button:only-child").text("Alone").css("border", "2px blue solid");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;
    &lt;button&gt;Sibling!&lt;/button&gt;
    &lt;button&gt;Sibling!&lt;/button&gt;
  &lt;/div&gt;

  &lt;div&gt;
    &lt;button&gt;Sibling!&lt;/button&gt;
  &lt;/div&gt;
  &lt;div&gt;
    None
  &lt;/div&gt;

  &lt;div&gt;  
    &lt;button&gt;Sibling!&lt;/button&gt;
    &lt;button&gt;Sibling!&lt;/button&gt;
    &lt;button&gt;Sibling!&lt;/button&gt;

  &lt;/div&gt;
  &lt;div&gt;
    &lt;button&gt;Sibling!&lt;/button&gt;
  &lt;/div&gt;</code>
</pre>
<h4>Result:</h4>
<pre>
<code class="html">[ &lt;li&gt;Glen&lt;/li&gt; ]</code>
</pre>
</div>
</div>
</li>
<li id="link-parent-">
<span class="fn"><a class="name" href="#link-parent-">parent</a>(  ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Matches all elements that are parents - they have child elements, including text.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Finds all tds with children, including text.</p>
<pre>
<code class="javascript">$("td:parent").fadeTo(1500, 0.3);</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;table border="1"&gt;

    &lt;tr&gt;&lt;td&gt;Value 1&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td&gt;Value 2&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;

  &lt;/table&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-parent-expr">
<span class="fn"><a class="name" href="#link-parent-expr">parent</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="An expression to filter the parents with.">expr</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Get a set of elements containing the unique parents of the matched set of elements.<br>You may use an optional expression to filter the set of parent elements that will match. </div>
<div class="example">
<h3>Example:</h3>
<p>Shows the parent of each element as (parent &gt; child).  Check the View Source to see the raw html.</p>
<pre>
<code class="javascript">
    $("*", document.body).each(function () {
      var parentTag = $(this).parent().get(0).tagName;
      $(this).prepend(document.createTextNode(parentTag + " &gt; "));
    });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;div, 
    &lt;span&gt;span, &lt;/span&gt;
    &lt;b&gt;b &lt;/b&gt;
  &lt;/div&gt;

  &lt;p&gt;p, 
    &lt;span&gt;span, 
      &lt;em&gt;em &lt;/em&gt;
    &lt;/span&gt;
  &lt;/p&gt;
  &lt;div&gt;div, 
    &lt;strong&gt;strong, 
      &lt;span&gt;span, &lt;/span&gt;

      &lt;em&gt;em, 
        &lt;b&gt;b, &lt;/b&gt;
      &lt;/em&gt;
    &lt;/strong&gt;
    &lt;b&gt;b &lt;/b&gt;

  &lt;/div&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Find the parent element of each paragraph with a class "selected".</p>
<pre>
<code class="javascript">$("p").parent(".selected").css("background", "yellow");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;&lt;p&gt;Hello&lt;/p&gt;&lt;/div&gt;

  &lt;div class="selected"&gt;&lt;p&gt;Hello Again&lt;/p&gt;&lt;/div&gt;
</code>
</pre>
</div>
</div>
</li>
<li id="link-parents-expr">
<span class="fn"><a class="name" href="#link-parents-expr">parents</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="An expression to filter the ancestors with">expr</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Get a set of elements containing the unique ancestors of the matched set of elements (except for the root element).<br>
<br>The matched elements can be filtered with an optional expression. <br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Find all parent elements of each span.</p>
<pre>
<code class="javascript">
    var parentEls = $("b").parents()
                          .map(function () { 
                                return this.tagName; 
                              })
                          .get().join(", ");
    $("b").append("&lt;strong&gt;" + parentEls + "&lt;/strong&gt;");

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;
    &lt;p&gt;
      &lt;span&gt;
        &lt;b&gt;My parents are: &lt;/b&gt;
      &lt;/span&gt;

    &lt;/p&gt;
  &lt;/div&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Click to find all unique div parent elements of each span.</p>
<pre>
<code class="javascript">
    function showParents() {
      $("div").css("border-color", "white");
      var len = $("span.selected")
                       .parents("div")
                       .css("border", "2px red solid")
                       .length;
      $("b").text("Unique div parents: " + len);
    }
    $("span").click(function () {
      $(this).toggleClass("selected");
      showParents();
    });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;
    &lt;div&gt;
      &lt;div&gt;&lt;span&gt;Hello&lt;/span&gt;&lt;/div&gt;
      &lt;span&gt;Hello Again&lt;/span&gt;

    &lt;/div&gt;
    &lt;div&gt;
      &lt;span&gt;And Hello Again&lt;/span&gt;
    &lt;/div&gt;
  &lt;/p&gt;

  &lt;b&gt;Click Hellos to toggle their parents.&lt;/b&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-password-">
<span class="fn"><a class="name" href="#link-password-">password</a>(  ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Matches all input elements of type password.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Finds all password inputs.</p>
<pre>
<code class="javascript">

    var input = $(":password").css({background:"yellow", border:"3px red solid"});
    $("div").text("For this type jQuery found " + input.length + ".")
            .css("color", "red");
    $("form").submit(function () { return false; }); // so it won't submit

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;form&gt;
    &lt;input type="button" value="Input Button"/&gt;
    &lt;input type="checkbox" /&gt;

    &lt;input type="file" /&gt;
    &lt;input type="hidden" /&gt;
    &lt;input type="image" /&gt;

    &lt;input type="password" /&gt;
    &lt;input type="radio" /&gt;
    &lt;input type="reset" /&gt;

    &lt;input type="submit" /&gt;
    &lt;input type="text" /&gt;
    &lt;select&gt;&lt;option&gt;Option&lt;option/&gt;&lt;/select&gt;

    &lt;textarea&gt;&lt;/textarea&gt;
    &lt;button&gt;Button&lt;/button&gt;
  &lt;/form&gt;
  &lt;div&gt;
  &lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-prepend-content">
<span class="fn"><a class="name" href="#link-prepend-content">prepend</a>( <span class="arg-type tooltip" title="">String, Element, jQuery</span> <span class="arg-name tooltip" title="Content to prepend to the target.">content</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Prepend content to the inside of every matched element.<br>This operation is the best way to insert elements inside, at the beginning, of all matched elements.</div>
<div class="example">
<h3>Example:</h3>
<p>Prepends some HTML to all paragraphs.</p>
<pre>
<code class="javascript">$("p").prepend("&lt;b&gt;Hello &lt;/b&gt;");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;there friend!&lt;/p&gt;

  &lt;p&gt;amigo!&lt;/p&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Prepends a DOM Element to all paragraphs.</p>
<pre>
<code class="javascript">$("p").prepend(document.createTextNode("Hello "));</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;is what I'd say&lt;/p&gt;
  &lt;p&gt;is what I said&lt;/p&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Prepends a jQuery object (similar to an Array of DOM Elements) to all paragraphs.</p>
<pre>
<code class="javascript">$("p").prepend( $("b") );</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt; is what was said.&lt;/p&gt;&lt;b&gt;Hello&lt;/b&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-prependTo-content">
<span class="fn"><a class="name" href="#link-prependTo-content">prependTo</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="target to which the content will be prepended.">content</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Prepend all of the matched elements to another, specified, set of elements.<br>This operation is, essentially, the reverse of doing a regular $(A).prepend(B), in that instead of prepending B to A, you're prepending A to B.</div>
<div class="example">
<h3>Example:</h3>
<p>Prepends all spans to the element with the ID "foo"</p>
<pre>
<code class="javascript">$("span").prependTo("#foo"); // check prepend() examples</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div id="foo"&gt;FOO!&lt;/div&gt;

  &lt;span&gt;I have something to say... &lt;/span&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-prev-expr">
<span class="fn"><a class="name" href="#link-prev-expr">prev</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="An expression to filter the previous Elements with.">expr</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Get a set of elements containing the unique previous siblings of each of the matched set of elements.<br>Use an optional expression to filter the matched set.<br>
<br>Only the immediately previous sibling is returned, not all previous siblings. </div>
<div class="example">
<h3>Example:</h3>
<p>Find the very previous sibling of each div.</p>
<pre>
<code class="javascript">
    var $curr = $("#start");
    $curr.css("background", "#f99");
    $("button").click(function () {
      $curr = $curr.prev();
      $("div").css("background", "");
      $curr.css("background", "#f99");
    });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;span&gt;has child&lt;/span&gt;&lt;/div&gt;

  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div id="start"&gt;&lt;/div&gt;

  &lt;div&gt;&lt;/div&gt;
  &lt;p&gt;&lt;button&gt;Go to Prev&lt;/button&gt;&lt;/p&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Find the very previous sibling of each paragraph that has a class "selected".</p>
<pre>
<code class="javascript">$("p").prev(".selected").css("background", "yellow");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;&lt;span&gt;Hello&lt;/span&gt;&lt;/div&gt;

  &lt;p class="selected"&gt;Hello Again&lt;/p&gt;
  &lt;p&gt;And Again&lt;/p&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-prevAll-expr">
<span class="fn"><a class="name" href="#link-prevAll-expr">prevAll</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="An expression to filter the previous Elements with.">expr</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Find all sibling elements before the current element.<br>Use an optional expression to filter the matched set. </div>
<div class="example">
<h3>Example:</h3>
<p>Locate all the divs before the last and give them a class.</p>
<pre>
<code class="javascript">$("div:last").prevAll().addClass("before");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-queue-">
<span class="fn"><a class="name" href="#link-queue-">queue</a>(  ) returns <span class="type"><span class="tooltip" title="">Array&lt;Function&gt;</span></span></span>
<div class="more">
<div class="desc">Returns a reference to the first element's queue (which is an array of functions).<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Show the length of the queue.</p>
<pre>
<code class="javascript">

    $("#show").click(function () {
      var n = $("div").queue("fx");
      $("span").text("Queue length is: " + n.length);
    });
    function runIt() {
      $("div").show("slow");
      $("div").animate({left:'+=200'},2000);
      $("div").slideToggle(1000);
      $("div").slideToggle("fast");
      $("div").animate({left:'-=200'},1500);
      $("div").hide("slow");
      $("div").show(1200);
      $("div").slideUp("normal", runIt);
    }
    runIt();

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;button id="show"&gt;Show Length of Queue&lt;/button&gt;
  &lt;span&gt;&lt;/span&gt;
  &lt;div&gt;&lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-queue-callback">
<span class="fn"><a class="name" href="#link-queue-callback">queue</a>( <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="The function to add to the queue.

<pre>function callback() {
  this; // dom element
  // to continue the queue you must call
  jQuery(this).dequeue();
}
</pre>">callback</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Adds a new function, to be executed, onto the end of the queue of all matched elements.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Queue a custom function.</p>
<pre>
<code class="javascript">
    $(document.body).click(function () {
      $("div").show("slow");
      $("div").animate({left:'+=200'},2000);
      $("div").queue(function () {
        $(this).addClass("newcolor");
        $(this).dequeue();
      });
      $("div").animate({left:'-=200'},500);
      $("div").queue(function () {
        $(this).removeClass("newcolor");
        $(this).dequeue();
      });
      $("div").slideUp();
    });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">Click here...
  &lt;div&gt;&lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-queue-queue">
<span class="fn"><a class="name" href="#link-queue-queue">queue</a>( <span class="arg-type tooltip" title="">Array&lt;Function&gt;</span> <span class="arg-name tooltip" title="The queue to replace all the queues with.  The functions have the same parameters and this value as queue(callback).">queue</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Replaces the queue of all matched element with this new queue (the array of functions).<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Set a queue array to delete the queue.</p>
<pre>
<code class="javascript">
    $("#start").click(function () {
      $("div").show("slow");
      $("div").animate({left:'+=200'},5000);
      $("div").queue(function () {
        $(this).addClass("newcolor");
        $(this).dequeue();
      });
      $("div").animate({left:'-=200'},1500);
      $("div").queue(function () {
        $(this).removeClass("newcolor");
        $(this).dequeue();
      });
      $("div").slideUp();
    });
    $("#stop").click(function () {
      $("div").queue("fx", []);
      $("div").stop();
    });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;button id="start"&gt;Start&lt;/button&gt;
  &lt;button id="stop"&gt;Stop&lt;/button&gt;
  &lt;div&gt;&lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-radio-">
<span class="fn"><a class="name" href="#link-radio-">radio</a>(  ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Matches all input elements of type radio.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Finds all radio inputs.</p>
<pre>
<code class="javascript">

    var input = $(":radio").css({background:"yellow", border:"3px red solid"});
    $("div").text("For this type jQuery found " + input.length + ".")
            .css("color", "red");
    $("form").submit(function () { return false; }); // so it won't submit

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;form&gt;
    &lt;input type="button" value="Input Button"/&gt;
    &lt;input type="checkbox" /&gt;

    &lt;input type="file" /&gt;
    &lt;input type="hidden" /&gt;
    &lt;input type="image" /&gt;

    &lt;input type="password" /&gt;
    &lt;input type="radio" name="asdf" /&gt;
    &lt;input type="radio" name="asdf" /&gt;

    &lt;input type="reset" /&gt;
    &lt;input type="submit" /&gt;
    &lt;input type="text" /&gt;

    &lt;select&gt;&lt;option&gt;Option&lt;option/&gt;&lt;/select&gt;
    &lt;textarea&gt;&lt;/textarea&gt;
    &lt;button&gt;Button&lt;/button&gt;
  &lt;/form&gt;

  &lt;div&gt;
  &lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-ready-fn">
<span class="fn"><a class="name" href="#link-ready-fn">ready</a>( <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="The function to be executed when the DOM is ready.

<pre>function callback(jQueryReference) {
  this; // document
}
</pre>">fn</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Binds a function to be executed whenever the DOM is ready to be traversed and manipulated.<br>&lt;p&gt;This is probably the most important function included in the event module, as it can greatly improve the response times of your web applications.&lt;/p&gt;&lt;p&gt;In a nutshell, this is a solid replacement for using window.onload, and attaching a function to that. By using this method, your bound function will be called the instant the DOM is ready to be read and manipulated, which is when what 99.99% of all JavaScript code needs to run.&lt;/p&gt;&lt;p&gt;There is one argument passed to the ready event handler: A reference to the jQuery function. You can name that argument whatever you like, and can therefore stick with the $ alias without risk of naming collisions.&lt;/p&gt;&lt;p&gt;Please ensure you have no code in your &lt;body&gt; onload event handler, otherwise $(document).ready() may not fire.&lt;/p&gt;&lt;p&gt;You can have as many $(document).ready events on your page as you like. The functions are then executed in the order they were added.&lt;/p&gt;</div>
<div class="example">
<h3>Example:</h3>
<p>Display a message when the DOM is loaded.</p>
<pre>
<code class="javascript">$("p").text("The DOM is now loaded and can be manipulated.");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;
  &lt;/p&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>To run code when the DOM loads, write:</p>
<pre>
<code class="javascript">$(document).ready(function(){
  // Your code here...
});</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>To use both the shortcut for $(document).ready() and the argument to write failsafe jQuery code using the $ alias, without relying on the global alias, write:</p>
<pre>
<code class="javascript">jQuery(function($) {
  // Your code using failsafe $ alias here...
});</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Commonly written as:</p>
<pre>
<code class="javascript">$(function() {
  // Your code here...
});</code>
</pre>
</div>
</div>
</li>
<li id="link-remove-expr">
<span class="fn"><a class="name" href="#link-remove-expr">remove</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="A jQuery expression to filter the set of elements to be removed.">expr</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Removes all matched elements from the DOM. <br>This does NOT remove them from the jQuery object, allowing you to use the matched elements further.  Note that this function starting with 1.2.2 will also remove all event handlers and internally cached data.  So:<br>
<br>&lt;code&gt;
$("#foo").remove().appendTo("#bar");
&lt;/code&gt;<br>
<br>should be written as<br>
<br>&lt;code&gt;
$("#foo").appendTo("#bar");
&lt;/code&gt;<br>
<br>to avoid losing the event handlers.<br>
<br>Can be filtered with an optional expression.</div>
<div class="example">
<h3>Example:</h3>
<p>Removes all paragraphs from the DOM</p>
<pre>
<code class="javascript">
    $("button").click(function () {
      $("p").remove();
    });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;Hello&lt;/p&gt; 
  how are 
  &lt;p&gt;you?&lt;/p&gt;
  &lt;button&gt;Call remove() on paragraphs</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Removes all paragraphs that contain "Hello" from the DOM</p>
<pre>
<code class="javascript">

    $("button").click(function () {
      $("p").remove(":contains('Hello')");
    });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p class="hello"&gt;Hello&lt;/p&gt;
  how are 
  &lt;p&gt;you?&lt;/p&gt;

  &lt;button&gt;Call remove(":contains('Hello')") on paragraphs</code>
</pre>
</div>
</div>
</li>
<li id="link-removeAttr-name">
<span class="fn"><a class="name" href="#link-removeAttr-name">removeAttr</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="The name of the property to remove.">name</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Remove an attribute from each of the matched elements.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Clicking the button enables the input next to it.</p>
<pre>
<code class="javascript">
    $("button").click(function () {
      $(this).next().removeAttr("disabled")
             .focus()
             .val("editable now");
    });
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;button&gt;Enable&lt;/button&gt;

  &lt;input type="text" disabled="disabled" value="can't edit this" /&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-removeClass-class">
<span class="fn"><a class="name" href="#link-removeClass-class">removeClass</a>( <span class="arg-type tooltip" title="">String ''(optional)''</span> <span class="arg-name tooltip" title="One or more CSS classes to remove from the elements, these are separated by spaces.">class</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Removes all or the specified class(es) from the set of matched elements.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Remove the class 'blue' from the matched elements.</p>
<pre>
<code class="javascript">$("p:even").removeClass("blue");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p class="blue under"&gt;Hello&lt;/p&gt;
  &lt;p class="blue under highlight"&gt;and&lt;/p&gt;
  &lt;p class="blue under"&gt;then&lt;/p&gt;

  &lt;p class="blue under"&gt;Goodbye&lt;/p&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Remove the class 'blue' and 'under' from the matched elements.</p>
<pre>
<code class="javascript">$("p:odd").removeClass("blue under");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p class="blue under"&gt;Hello&lt;/p&gt;

  &lt;p class="blue under highlight"&gt;and&lt;/p&gt;
  &lt;p class="blue under"&gt;then&lt;/p&gt;
  &lt;p class="blue under"&gt;Goodbye&lt;/p&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Remove all the classes from the matched elements.</p>
<pre>
<code class="javascript">$("p:eq(1)").removeClass();</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p class="blue under"&gt;Hello&lt;/p&gt;
  &lt;p class="blue under highlight"&gt;and&lt;/p&gt;
  &lt;p class="blue under"&gt;then&lt;/p&gt;

  &lt;p class="blue under"&gt;Goodbye&lt;/p&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-replaceAll-selector">
<span class="fn"><a class="name" href="#link-replaceAll-selector">replaceAll</a>( <span class="arg-type tooltip" title="">Selector</span> <span class="arg-name tooltip" title="The elements to find and replace the matched elements with.">selector</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Replaces the elements matched by the specified selector with the matched elements.<br>This function is the complement to replaceWith() which does the same task with the parameters reversed.</div>
<div class="example">
<h3>Example:</h3>
<p>Replace all the paragraphs with bold words.</p>
<pre>
<code class="javascript">$("&lt;b&gt;Paragraph. &lt;/b&gt;").replaceAll("p"); // check replaceWith() examples</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;Hello&lt;/p&gt;

  &lt;p&gt;cruel&lt;/p&gt;
  &lt;p&gt;World&lt;/p&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-replaceWith-content">
<span class="fn"><a class="name" href="#link-replaceWith-content">replaceWith</a>( <span class="arg-type tooltip" title="">String, Element, jQuery</span> <span class="arg-name tooltip" title="Content to replace the matched elements with.">content</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Replaces all matched elements with the specified HTML or DOM elements.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>On click, replace the button with a div containing the same word.</p>
<pre>
<code class="javascript">

    $("button").click(function () {
      $(this).replaceWith("&lt;div&gt;" + $(this).text() + "&lt;/div&gt;");
    });
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;button&gt;First&lt;/button&gt;
  &lt;button&gt;Second&lt;/button&gt;

  &lt;button&gt;Third&lt;/button&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Replace all the paragraphs with bold words.</p>
<pre>
<code class="javascript">$("p").replaceWith("&lt;b&gt;Paragraph. &lt;/b&gt;");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;Hello&lt;/p&gt;
  &lt;p&gt;cruel&lt;/p&gt;

  &lt;p&gt;World&lt;/p&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Replace all the paragraphs with empty div elements.</p>
<pre>
<code class="javascript">$("p").replaceWith(document.createElement("div"));</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;Hello&lt;/p&gt;

  &lt;p&gt;cruel&lt;/p&gt;
  &lt;p&gt;World&lt;/p&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>On click, replace each paragraph with a jQuery div object that is already in the DOM.  Notice it doesn't clone the object but rather moves it to replace the paragraph.</p>
<pre>
<code class="javascript">
    $("p").click(function () {
      $(this).replaceWith($("div"));
    });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;Hello&lt;/p&gt;
  &lt;p&gt;cruel&lt;/p&gt;
  &lt;p&gt;World&lt;/p&gt;

  &lt;div&gt;Replaced!&lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-reset-">
<span class="fn"><a class="name" href="#link-reset-">reset</a>(  ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Matches all input elements of type reset.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Finds all reset inputs.</p>
<pre>
<code class="javascript">

    var input = $(":reset").css({background:"yellow", border:"3px red solid"});
    $("div").text("For this type jQuery found " + input.length + ".")
            .css("color", "red");
    $("form").submit(function () { return false; }); // so it won't submit

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;form&gt;
    &lt;input type="button" value="Input Button"/&gt;
    &lt;input type="checkbox" /&gt;

    &lt;input type="file" /&gt;
    &lt;input type="hidden" /&gt;
    &lt;input type="image" /&gt;

    &lt;input type="password" /&gt;
    &lt;input type="radio" /&gt;
    &lt;input type="reset" /&gt;

    &lt;input type="submit" /&gt;
    &lt;input type="text" /&gt;
    &lt;select&gt;&lt;option&gt;Option&lt;option/&gt;&lt;/select&gt;

    &lt;textarea&gt;&lt;/textarea&gt;
    &lt;button&gt;Button&lt;/button&gt;
  &lt;/form&gt;
  &lt;div&gt;
  &lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-resize-fn">
<span class="fn"><a class="name" href="#link-resize-fn">resize</a>( <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="A function to bind to the resize event on each of the matched elements.
<pre>function callback(eventObject) {
  this; // dom element
}
</pre>">fn</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Bind a function to the resize event of each matched element.<br>The resize event fires when a document view is resized</div>
<div class="example">
<h3>Example:</h3>
<p>To make resizing the web page window a pain in the neck, try:</p>
<pre>
<code class="javascript">$(window).resize(function(){
  alert("Stop it!");
});</code>
</pre>
</div>
</div>
</li>
<li id="link-scroll-fn">
<span class="fn"><a class="name" href="#link-scroll-fn">scroll</a>( <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="A function to bind to the scroll event on each of the matched elements.
<pre>function callback(eventObject) {
  this; // dom element
}

</pre>">fn</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Bind a function to the scroll event of each matched element.<br>The scroll event fires when a document view is scrolled.</div>
<div class="example">
<h3>Example:</h3>
<p>To do something when your page is scrolled:</p>
<pre>
<code class="javascript">
    $("p").clone().appendTo(document.body);
    $("p").clone().appendTo(document.body);
    $("p").clone().appendTo(document.body);
    $(window).scroll(function () { 
      $("span").css("display", "inline").fadeOut("slow"); 
    });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;Try scrolling the iframe.&lt;/div&gt;
  &lt;p&gt;Paragraph - &lt;span&gt;Scroll happened!&lt;/span&gt;&lt;/p&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-select-">
<span class="fn"><a class="name" href="#link-select-">select</a>(  ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Trigger the select event of each matched element.<br>This causes all of the functions that have been bound to that select event to be executed, and calls the browser's default select action on the matching element(s). This default action can be prevented by returning false from one of the functions bound to the select event.</div>
<div class="example">
<h3>Example:</h3>
<p>To trigger the select event on all input elements, try:</p>
<pre>
<code class="javascript">$("input").select();</code>
</pre>
</div>
</div>
</li>
<li id="link-select-fn">
<span class="fn"><a class="name" href="#link-select-fn">select</a>( <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="A function to bind to the select event on each of the matched elements.

<pre>function callback(eventObject) {
  this; // dom element
}
</pre>">fn</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Bind a function to the select event of each matched element.<br>The select event fires when a user selects some text in a text field, including input and textarea.</div>
<div class="example">
<h3>Example:</h3>
<p>To do something when text in input boxes is selected:</p>
<pre>
<code class="javascript">
    $(document).select( function () { 
      $("div").text("Something was selected").show().fadeOut(1000); 
    });
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;
    Click and drag the mouse to select text in the inputs.
  &lt;/p&gt;

  &lt;input type="text" value="Some text" /&gt;
  &lt;input type="text" value="to test on" /&gt;

  &lt;div&gt;&lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-selected-">
<span class="fn"><a class="name" href="#link-selected-">selected</a>(  ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Matches all elements that are selected.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Attaches a change even to the select that gets the text for each selected option and writes them in the div.  It then triggers the event for the initial text draw.</p>
<pre>
<code class="javascript">

    $("select").change(function () {
          var str = "";
          $("select option:selected").each(function () {
                str += $(this).text() + " ";
              });
          $("div").text(str);
        })
        .trigger('change');
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;select name="garden" multiple="multiple"&gt;

    &lt;option&gt;Flowers&lt;/option&gt;
    &lt;option selected="selected"&gt;Shrubs&lt;/option&gt;
    &lt;option&gt;Trees&lt;/option&gt;
    &lt;option selected="selected"&gt;Bushes&lt;/option&gt;

    &lt;option&gt;Grass&lt;/option&gt;
    &lt;option&gt;Dirt&lt;/option&gt;
  &lt;/select&gt;
  &lt;div&gt;&lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-serialize-">
<span class="fn"><a class="name" href="#link-serialize-">serialize</a>(  ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Serializes a set of input elements into a string of data. This will serialize all given elements.<br>As of jQuery 1.2 the serialize method correctly serializes forms. For older versions of jQuery, the [http://www.malsup.com/jquery/form/ Form Plugin's] fieldSerialize method should be used.</div>
<div class="example">
<h3>Example:</h3>
<p>Serialize a form to a query string, that could be sent to a server in an Ajax request.</p>
<pre>
<code class="javascript">
    function showValues() {
      var str = $("form").serialize();
      $("#results").text(str);
    }

    $(":checkbox, :radio").click(showValues);
    $("select").change(showValues);
    showValues();

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;form&gt;
    &lt;select name="single"&gt;
      &lt;option&gt;Single&lt;/option&gt;
      &lt;option&gt;Single2&lt;/option&gt;

    &lt;/select&gt;
    &lt;select name="multiple" multiple="multiple"&gt;
      &lt;option selected="selected"&gt;Multiple&lt;/option&gt;
      &lt;option&gt;Multiple2&lt;/option&gt;

      &lt;option selected="selected"&gt;Multiple3&lt;/option&gt;
    &lt;/select&gt;&lt;br/&gt;
    &lt;input type="checkbox" name="check" value="check1"/&gt; check1
    &lt;input type="checkbox" name="check" value="check2" checked="checked"/&gt; check2
    &lt;input type="radio" name="radio" value="radio1" checked="checked"/&gt; radio1
    &lt;input type="radio" name="radio" value="radio2"/&gt; radio2
  &lt;/form&gt;

  &lt;p&gt;&lt;tt id="results"&gt;&lt;/tt&gt;&lt;/p&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-serializeArray-">
<span class="fn"><a class="name" href="#link-serializeArray-">serializeArray</a>(  ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Serializes all forms and form elements (like the &lt;a href='Ajax/serialize'&gt;.serialize()&lt;/a&gt; method) but returns a JSON data structure for you to work with.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Get the values from a form, iterate through them, and append them to a results display.</p>
<pre>
<code class="javascript">
    function showValues() {
      var fields = $(":input").serializeArray();
      $("#results").empty();
      jQuery.each(fields, function(i, field){
        $("#results").append(field.value + " ");
      });
    }

    $(":checkbox, :radio").click(showValues);
    $("select").change(showValues);
    showValues();

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;&lt;b&gt;Results:&lt;/b&gt; &lt;span id="results"&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;form&gt;
    &lt;select name="single"&gt;

      &lt;option&gt;Single&lt;/option&gt;
      &lt;option&gt;Single2&lt;/option&gt;
    &lt;/select&gt;
    &lt;select name="multiple" multiple="multiple"&gt;

      &lt;option selected="selected"&gt;Multiple&lt;/option&gt;
      &lt;option&gt;Multiple2&lt;/option&gt;
      &lt;option selected="selected"&gt;Multiple3&lt;/option&gt;

    &lt;/select&gt;&lt;br/&gt;
    &lt;input type="checkbox" name="check" value="check1"/&gt; check1
    &lt;input type="checkbox" name="check" value="check2" checked="checked"/&gt; check2
    &lt;input type="radio" name="radio" value="radio1" checked="checked"/&gt; radio1
    &lt;input type="radio" name="radio" value="radio2"/&gt; radio2
  &lt;/form&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-show-">
<span class="fn"><a class="name" href="#link-show-">show</a>(  ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Displays each of the set of matched elements if they are hidden.<br>Same as &lt;a href='Effects/show#speedcallback'&gt;show( speed, [callback] )&lt;/a&gt; without animations. Doesn't change anything if the selected elements are all visible. It doesn't matter if the element is hidden via a hide() call, or via a display:none in a stylesheet.</div>
<div class="example">
<h3>Example:</h3>
<p>Shows all paragraphs.</p>
<pre>
<code class="javascript">$("p").show()</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p style="display:none"&gt;Hello&lt;/p&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-show-speedcallback">
<span class="fn"><a class="name" href="#link-show-speedcallback">show</a>( <span class="arg-type tooltip" title="">String, Number </span> <span class="arg-name tooltip" title="A string representing one of the three predefined speeds (&quot;slow&quot;, &quot;normal&quot;, or &quot;fast&quot;) or the number of milliseconds to run the animation (e.g. 1000).">speed</span>, <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="A function to be executed whenever the animation completes, executes once for each element animated against.

<pre>function callback() {
  this; // dom element
}
</pre>">callback</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Show all matched elements using a graceful animation and firing an optional callback after completion.<br>The height, width, and opacity of each of the matched elements are changed dynamically according to the specified speed.</div>
<div class="example">
<h3>Example:</h3>
<p>Animates all hidden paragraphs to show slowly, completing the animation within 600 milliseconds.</p>
<pre>
<code class="javascript">
    $("button").click(function () {
      $("p").show("slow");
    });
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;button&gt;Show it&lt;/button&gt;

  &lt;p style="display: none"&gt;Hello&lt;/p&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Animates all hidden divs to show fastly in order, completing each animation within 200 milliseconds. Once each animation is done, it starts the next one.</p>
<pre>
<code class="javascript">
    $("#showr").click(function () {
      $("div:eq(0)").show("fast", function () {
        // use callee so don't have to name the function
        $(this).next().show("fast", arguments.callee); 
      });
    });
    $("#hidr").click(function () {
      $("div").hide(2000);
    });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;button id="showr"&gt;Show&lt;/button&gt;
  &lt;button id="hidr"&gt;Hide&lt;/button&gt;
  &lt;div&gt;Hello,&lt;/div&gt;

  &lt;div&gt;how&lt;/div&gt;
  &lt;div&gt;are&lt;/div&gt;
  &lt;div&gt;you?&lt;/div&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Animates all span and input elements to show normally. Once the animation is done, it changes the text.</p>
<pre>
<code class="javascript">
    function doIt() {
      $("span,div").show("normal");
    }
    $("button").click(doIt); // can pass in function name
    $("form").submit(function () {
      if ($("input").val() == "yes") {
        $("p").show(4000, function () {
          $(this).text("Ok, DONE! (now showing)");
        });
      }
      $("span,div").hide("normal");
      return false; // to stop the submit
    });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;button&gt;Do it!&lt;/button&gt;
  &lt;span&gt;Are you sure? (type 'yes' if you are) &lt;/span&gt;
  &lt;div&gt;
    &lt;form&gt;

      &lt;input type="text" /&gt;
    &lt;/form&gt;
  &lt;/div&gt;
  &lt;p style="display:none;"&gt;I'm hidden...&lt;/p&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-siblings-expr">
<span class="fn"><a class="name" href="#link-siblings-expr">siblings</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="An expression to filter the sibling Elements with">expr</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Get a set of elements containing all of the unique siblings of each of the matched set of elements.<br>
<br>Can be filtered with an optional expressions. <br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Find the unique siblings of all yellow li elements in the 3 lists (including other yellow li elements if appropriate).</p>
<pre>
<code class="javascript">

    var len = $(".hilite").siblings()
                          .css("color", "red")
                          .length;
    $("b").text(len);
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;ul&gt;
    &lt;li&gt;One&lt;/li&gt;

    &lt;li&gt;Two&lt;/li&gt;
    &lt;li class="hilite"&gt;Three&lt;/li&gt;
    &lt;li&gt;Four&lt;/li&gt;
  &lt;/ul&gt;

  &lt;ul&gt;
    &lt;li&gt;Five&lt;/li&gt;
    &lt;li&gt;Six&lt;/li&gt;
    &lt;li&gt;Seven&lt;/li&gt;

  &lt;/ul&gt;
  &lt;ul&gt;
    &lt;li&gt;Eight&lt;/li&gt;
    &lt;li class="hilite"&gt;Nine&lt;/li&gt;

    &lt;li&gt;Ten&lt;/li&gt;
    &lt;li class="hilite"&gt;Eleven&lt;/li&gt;
  &lt;/ul&gt;
  &lt;p&gt;Unique siblings: &lt;b&gt;&lt;/b&gt;&lt;/p&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Find all siblings with a class "selected" of each div.</p>
<pre>
<code class="javascript">$("p").siblings(".selected").css("background", "yellow");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;&lt;span&gt;Hello&lt;/span&gt;&lt;/div&gt;

  &lt;p class="selected"&gt;Hello Again&lt;/p&gt;
  &lt;p&gt;And Again&lt;/p&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-siblings-prevsiblings">
<span class="fn"><a class="name" href="#link-siblings-prevsiblings">siblings</a>( <span class="arg-type tooltip" title="">Selector</span> <span class="arg-name tooltip" title="Any valid selector.">prev</span>, <span class="arg-type tooltip" title="">Selector</span> <span class="arg-name tooltip" title="A filter selector to match elements that are following siblings to the first selector.">siblings</span> ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Matches all sibling elements after the "prev" element that match the filtering "siblings" selector.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Finds all divs that are siblings after the element with #prev as its id.  Notice the span isn't selected since it is not a div and the "niece" isn't selected since it is a child of a sibling, not an actual sibling.</p>
<pre>
<code class="javascript">$("#prev ~ div").css("border", "3px groove blue");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;div (doesn't match since before #prev)&lt;/div&gt;
  &lt;div id="prev"&gt;div#prev&lt;/div&gt;
  &lt;div&gt;div sibling&lt;/div&gt;

  &lt;div&gt;div sibling &lt;div id="small"&gt;div neice&lt;/div&gt;&lt;/div&gt;
  &lt;span&gt;span sibling (not div)&lt;/span&gt;
  &lt;div&gt;div sibling&lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-size-">
<span class="fn"><a class="name" href="#link-size-">size</a>(  ) returns <span class="type"><span class="tooltip" title="A valid numeric.">Number</span></span></span>
<div class="more">
<div class="desc">The number of elements in the jQuery object.<br>This returns the same number as the '&lt;a href='Core/length'&gt;length&lt;/a&gt;' property of the jQuery object.</div>
<div class="example">
<h3>Example:</h3>
<p>Count the divs.  Click to add more.</p>
<pre>
<code class="javascript"> 
    $(document.body).click(function () {
      $(document.body).append($("&lt;div&gt;"));
      var n = $("div").size();
      $("span").text("There are " + n + " divs." +
                     "Click to add more.");
    }).click(); // trigger the click to start

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;span&gt;&lt;/span&gt;
  &lt;div&gt;&lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-slice-startend">
<span class="fn"><a class="name" href="#link-slice-startend">slice</a>( <span class="arg-type tooltip" title="">Integer</span> <span class="arg-name tooltip" title="Where to start the subset. The first element is at zero. Can be negative to start from the end of the selection.">start</span>, <span class="arg-type tooltip" title="">Integer</span> <span class="arg-name tooltip" title="Where to end the subset. If unspecified, ends at the end of the selection.">end</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Selects a subset of the matched elements.<br>Behaves exactly like the built-in Array slice method. </div>
<div class="example">
<h3>Example:</h3>
<p>Turns divs yellow based on a random slice.</p>
<pre>
<code class="javascript">

    function colorEm() {
      var $div = $("div");
      var start = Math.floor(Math.random() *
                             $div.length);
      var end = Math.floor(Math.random() *
                           ($div.length - start)) +
                           start + 1;
      if (end == $div.length) end = undefined;
      $div.css("background", "");
      if (end) 
        $div.slice(start, end).css("background", "yellow");   
       else
        $div.slice(start).css("background", "yellow");
      
      $("span").text('$("div").slice(' + start +
                     (end ? ', ' + end : '') +
                     ').css("background", "yellow");');
    }

    $("button").click(colorEm);

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;button&gt;Turn slice yellow&lt;/button&gt;
  &lt;span&gt;Click the button!&lt;/span&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;

  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;

  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Selects all paragraphs, then slices the selection to include only the first element.</p>
<pre>
<code class="javascript">$("p").slice(0, 1).wrapInner("&lt;b&gt;&lt;/b&gt;");</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Selects all paragraphs, then slices the selection to include only the first and second element.</p>
<pre>
<code class="javascript">$("p").slice(0, 2).wrapInner("&lt;b&gt;&lt;/b&gt;");</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Selects all paragraphs, then slices the selection to include only the second element.</p>
<pre>
<code class="javascript">$("p").slice(1, 2).wrapInner("&lt;b&gt;&lt;/b&gt;");</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Selects all paragraphs, then slices the selection to include only the second and third element.</p>
<pre>
<code class="javascript">$("p").slice(1).wrapInner("&lt;b&gt;&lt;/b&gt;");</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Selects all paragraphs, then slices the selection to include only the third element.</p>
<pre>
<code class="javascript">$("p").slice(-1).wrapInner("&lt;b&gt;&lt;/b&gt;");</code>
</pre>
</div>
</div>
</li>
<li id="link-slideDown-speedcallback">
<span class="fn"><a class="name" href="#link-slideDown-speedcallback">slideDown</a>( <span class="arg-type tooltip" title="">String, Number </span> <span class="arg-name tooltip" title="A string representing one of the three predefined speeds (&quot;slow&quot;, &quot;normal&quot;, or &quot;fast&quot;) or the number of milliseconds to run the animation (e.g. 1000).">speed</span>, <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="A function to be executed whenever the animation completes, executes once for each element animated against.

<pre>function callback() {
  this; // dom element
}
</pre>">callback</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Reveal all matched elements by adjusting their height and firing an optional callback after completion.<br>Only the height is adjusted for this animation, causing all matched elements to be revealed in a "sliding" manner.</div>
<div class="example">
<h3>Example:</h3>
<p>Animates all divs to slide down and show themselves over 600 milliseconds.</p>
<pre>
<code class="javascript">
    $(document.body).click(function () {
      if ($("div:first").is(":hidden")) {
        $("div").slideDown("slow");
      } else {
        $("div").hide();
      }
    });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">Click me!
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Animates all inputs to slide down, completing the animation within 1000 milliseconds. Once the animation is done, the input look is changed especially if it is the middle input which gets the focus.</p>
<pre>
<code class="javascript">
    $("div").click(function () {
      $(this).css({ borderStyle:"inset", cursor:"wait" });
      $("input").slideDown(1000,function(){
        $(this).css("border", "2px red inset")
               .filter(".middle")
                 .css("background", "yellow")
                 .focus();
        $("div").css("visibility", "hidden");
      });
    });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;Push!&lt;/div&gt;
  &lt;input type="text" /&gt;
  &lt;input type="text" class="middle" /&gt;

  &lt;input type="text" /&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-slideToggle-speedcallback">
<span class="fn"><a class="name" href="#link-slideToggle-speedcallback">slideToggle</a>( <span class="arg-type tooltip" title="">String, Number </span> <span class="arg-name tooltip" title="A string representing one of the three predefined speeds (&quot;slow&quot;, &quot;normal&quot;, or &quot;fast&quot;) or the number of milliseconds to run the animation (e.g. 1000).">speed</span>, <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="A function to be executed whenever the animation completes, executes once for each element animated against.

<pre>function callback() {
  this; // dom element
}
</pre>">callback</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Toggle the visibility of all matched elements by adjusting their height and firing an optional callback after completion.<br>Only the height is adjusted for this animation, causing all matched elements to be hidden or shown in a "sliding" manner.</div>
<div class="example">
<h3>Example:</h3>
<p>Animates all paragraphs to slide up or down, completing the animation within 600 milliseconds.</p>
<pre>
<code class="javascript">
    $("button").click(function () {
      $("p").slideToggle("slow");
    });
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;button&gt;Toggle&lt;/button&gt;

  &lt;p&gt;
    This is the paragraph to end all paragraphs.  You
    should feel &lt;em&gt;lucky&lt;/em&gt; to have seen such a paragraph in
    your life.  Congratulations!
  &lt;/p&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Animates divs between dividers with a toggle that makes some appear and some disappear.</p>
<pre>
<code class="javascript">
    $("button").click(function () {
      $("div:not(.still)").slideToggle("slow", function () {
        var n = parseInt($("span").text(), 10);
        $("span").text(n + 1);
      });
    });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;button&gt;Toggle&lt;/button&gt; There have been &lt;span&gt;0&lt;/span&gt; toggled divs.
  &lt;div&gt;&lt;/div&gt;&lt;div class="still"&gt;&lt;/div&gt;

  &lt;div style="display:none;"&gt;&lt;/div&gt;&lt;div class="still"&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;&lt;div class="still"&gt;&lt;/div&gt;
  &lt;div class="hider"&gt;&lt;/div&gt;&lt;div class="still"&gt;&lt;/div&gt;

  &lt;div class="hider"&gt;&lt;/div&gt;&lt;div class="still"&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-slideUp-speedcallback">
<span class="fn"><a class="name" href="#link-slideUp-speedcallback">slideUp</a>( <span class="arg-type tooltip" title="">String, Number </span> <span class="arg-name tooltip" title="A string representing one of the three predefined speeds (&quot;slow&quot;, &quot;normal&quot;, or &quot;fast&quot;) or the number of milliseconds to run the animation (e.g. 1000).">speed</span>, <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="A function to be executed whenever the animation completes, executes once for each element animated against.

<pre>function callback() {
  this; // dom element
}
</pre>">callback</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Hide all matched elements by adjusting their height and firing an optional callback after completion.<br>Only the height is adjusted for this animation, causing all matched elements to be hidden in a "sliding" manner.</div>
<div class="example">
<h3>Example:</h3>
<p>Animates all divs to slide up, completing the animation within 400 milliseconds.</p>
<pre>
<code class="javascript">
    $(document.body).click(function () {
      if ($("div:first").is(":hidden")) {
        $("div").show("fast");
      } else {
        $("div").slideUp();
      }
    });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">Click me!
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;

  &lt;div&gt;&lt;/div&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Animates all paragraph to slide up, completing the animation within 200 milliseconds. Once the animation is done, it displays an alert.</p>
<pre>
<code class="javascript">
    $("button").click(function () {
      $(this).parent().slideUp("slow", function () {
        $("#msg").text($("button", this).text() + " has completed.");
      });
    });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;
    &lt;button&gt;Hide One&lt;/button&gt;
    &lt;input type="text" value="One" /&gt;

  &lt;/div&gt;
  &lt;div&gt;
    &lt;button&gt;Hide Two&lt;/button&gt;
    &lt;input type="text" value="Two" /&gt;

  &lt;/div&gt;
  &lt;div&gt;
    &lt;button&gt;Hide Three&lt;/button&gt;
    &lt;input type="text" value="Three" /&gt;

  &lt;/div&gt;
  &lt;div id="msg"&gt;&lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-stop-">
<span class="fn"><a class="name" href="#link-stop-">stop</a>(  ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Stops all the currently running animations on all the specified elements. <br>If any animations are queued to run, then they will begin immediately.</div>
<div class="example">
<h3>Example:</h3>
<p>Click the Go button once to start the animation, then click the STOP button to stop it where it's currently positioned.  Another option is to click several buttons to queue them up and see that stop just kills the currently playing one.</p>
<pre>
<code class="javascript">
    // Start animation
    $("#go").click(function(){
      $(".block").animate({left: '+=100px'}, 2000);
    });

    // Stop animation when button is clicked
    $("#stop").click(function(){
      $(".block").stop();
    });

    // Start animation in the opposite direction
    $("#back").click(function(){
      $(".block").animate({left: '-=100px'}, 2000);
    });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;button id="go"&gt;Go&lt;/button&gt; 
  &lt;button id="stop"&gt;STOP!&lt;/button&gt;
  &lt;button id="back"&gt;Back&lt;/button&gt;
  &lt;div class="block"&gt;&lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-submit-">
<span class="fn"><a class="name" href="#link-submit-">submit</a>(  ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Matches all input elements of type submit.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Finds all submit inputs.</p>
<pre>
<code class="javascript">
    var input = $(":submit").css({background:"yellow", border:"3px red solid"});
    $("div").text("For this type jQuery found " + input.length + ".")
            .css("color", "red");
    $("form").submit(function () { return false; }); // so it won't submit

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;form&gt;
    &lt;input type="button" value="Input Button"/&gt;
    &lt;input type="checkbox" /&gt;

    &lt;input type="file" /&gt;
    &lt;input type="hidden" /&gt;
    &lt;input type="image" /&gt;

    &lt;input type="password" /&gt;
    &lt;input type="radio" /&gt;
    &lt;input type="reset" /&gt;

    &lt;input type="submit" /&gt;
    &lt;input type="text" /&gt;
    &lt;select&gt;&lt;option&gt;Option&lt;option/&gt;&lt;/select&gt;

    &lt;textarea&gt;&lt;/textarea&gt;
    &lt;button&gt;Button&lt;/button&gt;
  &lt;/form&gt;
  &lt;div&gt;
  &lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-submit-">
<span class="fn"><a class="name" href="#link-submit-">submit</a>(  ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Trigger the submit event of each matched element.<br>This causes all of the functions that have been bound to that submit event to be executed, and calls the browser's default submit action on the matching element(s). This default action can be prevented by returning false from one of the functions bound to the submit event.</div>
<div class="example">
<h3>Example:</h3>
<p>To trigger the submit event on the first form on the page, try:</p>
<pre>
<code class="javascript">$("form:first").submit();</code>
</pre>
</div>
</div>
</li>
<li id="link-submit-fn">
<span class="fn"><a class="name" href="#link-submit-fn">submit</a>( <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="A function to bind to the submit event on each of the matched elements.
<pre>function callback(eventObject) {
  this; // dom element
}
</pre>">fn</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Bind a function to the submit event of each matched element.<br>The select event fires when a form is submitted</div>
<div class="example">
<h3>Example:</h3>
<p>If you'd like to prevent forms from being submitted unless a flag variable is set, try:</p>
<pre>
<code class="javascript">

    $("form").submit(function() {
      if ($("input:first").val() == "correct") {
        $("span").text("Validated...").show();
        return true;
      }
      $("span").text("Not valid!").show().fadeOut(1000);
      return false;
    });
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;Type 'correct' to validate.&lt;/p&gt;
  &lt;form action="javascript:alert('success!');"&gt;
    &lt;div&gt;
      &lt;input type="text" /&gt;

      &lt;input type="submit" /&gt;
    &lt;/div&gt;
  &lt;/form&gt;
  &lt;span&gt;&lt;/span&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>If you'd like to prevent forms from being submitted unless a flag variable is set, try:</p>
<pre>
<code class="javascript">$("form").submit( function () {
  return this.some_flag_variable;
} );</code>
</pre>
</div>
</div>
</li>
<li id="link-text-">
<span class="fn"><a class="name" href="#link-text-">text</a>(  ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Matches all input elements of type text.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Finds all text inputs.</p>
<pre>
<code class="javascript">

    var input = $(":text").css({background:"yellow", border:"3px red solid"});
    $("div").text("For this type jQuery found " + input.length + ".")
            .css("color", "red");
    $("form").submit(function () { return false; }); // so it won't submit

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;form&gt;
    &lt;input type="button" value="Input Button"/&gt;
    &lt;input type="checkbox" /&gt;

    &lt;input type="file" /&gt;
    &lt;input type="hidden" /&gt;
    &lt;input type="image" /&gt;

    &lt;input type="password" /&gt;
    &lt;input type="radio" /&gt;
    &lt;input type="reset" /&gt;

    &lt;input type="submit" /&gt;
    &lt;input type="text" /&gt;
    &lt;select&gt;&lt;option&gt;Option&lt;option/&gt;&lt;/select&gt;

    &lt;textarea&gt;&lt;/textarea&gt;
    &lt;button&gt;Button&lt;/button&gt;
  &lt;/form&gt;
  &lt;div&gt;
  &lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-text-">
<span class="fn"><a class="name" href="#link-text-">text</a>(  ) returns <span class="type"><span class="tooltip" title="A string of characters.">String</span></span></span>
<div class="more">
<div class="desc">Get the combined text contents of all matched elements.<br>The result is a string that contains the combined text contents of all matched elements. This method works on both HTML and XML documents.</div>
<div class="example">
<h3>Example:</h3>
<p>Find the text in the first paragraph (stripping out the html), then set the html of the last paragraph to show it is just text (the red bold is gone).</p>
<pre>
<code class="javascript">

    var str = $("p:first").text();
    $("p:last").html(str);
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;&lt;b&gt;Test&lt;/b&gt; Paragraph.&lt;/p&gt;

  &lt;p&gt;&lt;/p&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-text-">
<span class="fn"><a class="name" href="#link-text-">text</a>(  ) returns <span class="type"><span class="tooltip" title="A string of characters.">String</span></span></span>
<div class="more">
<div class="desc">Get the combined text contents of all matched elements.<br>The result is a string that contains the combined text contents of all matched elements. This method works on both HTML and XML documents.</div>
<div class="example">
<h3>Example:</h3>
<p>Find the text in the first paragraph (stripping out the html), then set the html of the last paragraph to show it is just text (the red bold is gone).</p>
<pre>
<code class="javascript">

    var str = $("p:first").text();
    $("p:last").html(str);
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;&lt;b&gt;Test&lt;/b&gt; Paragraph.&lt;/p&gt;

  &lt;p&gt;&lt;/p&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-text-val">
<span class="fn"><a class="name" href="#link-text-val">text</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="The text value to set the contents of the element to.">val</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Set the text contents of all matched elements.<br>Similar to html(), but escapes HTML (replace "&lt;" and "&gt;" with their HTML entities).</div>
<div class="example">
<h3>Example:</h3>
<p>Add text to the paragraph (notice the bold tag is escaped).</p>
<pre>
<code class="javascript">$("p").text("&lt;b&gt;Some&lt;/b&gt; new text.");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;Test Paragraph.&lt;/p&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-text-val">
<span class="fn"><a class="name" href="#link-text-val">text</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="The text value to set the contents of the element to.">val</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Set the text contents of all matched elements.<br>Similar to html(), but escapes HTML (replace "&lt;" and "&gt;" with their HTML entities).</div>
<div class="example">
<h3>Example:</h3>
<p>Add text to the paragraph (notice the bold tag is escaped).</p>
<pre>
<code class="javascript">$("p").text("&lt;b&gt;Some&lt;/b&gt; new text.");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;Test Paragraph.&lt;/p&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-toggle-">
<span class="fn"><a class="name" href="#link-toggle-">toggle</a>(  ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Toggles each of the set of matched elements.<br>If they are shown, toggle makes them hidden. If they are hidden, toggle makes them shown.</div>
<div class="example">
<h3>Example:</h3>
<p>Toggles all paragraphs.</p>
<pre>
<code class="javascript">

    $("button").click(function () {
      $("p").toggle();
    });
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;button&gt;Toggle&lt;/button&gt;
  &lt;p&gt;Hello&lt;/p&gt;
  &lt;p style="display: none"&gt;Good Bye&lt;/p&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-toggle-fnfn">
<span class="fn"><a class="name" href="#link-toggle-fnfn">toggle</a>( <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="The function to execute on every even click.

<pre>function callback(eventObject) {
  this; // dom element
}
</pre>">fn</span>, <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="The function to execute on every odd click.
<pre>function callback(eventObject) {
  this; // dom element
}
</pre>">fn</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Toggle between two function calls every other click.<br>&lt;p&gt;Whenever a matched element is clicked, the first specified function is fired, when clicked again, the second is fired. All subsequent clicks continue to rotate through the two functions.&lt;/p&gt;&lt;p&gt;Use unbind("click") to remove.&lt;/p&gt;</div>
<div class="example">
<h3>Example:</h3>
<p>Click to toggle highlight on the list item.</p>
<pre>
<code class="javascript">
    $("li").toggle(
      function () {
        $(this).css("list-style-type", "disc")
               .css("color", "blue");
      },
      function () {
        $(this).css({"list-style-type":"", "color":""});
      }
    );

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;ul&gt;
    &lt;li&gt;Go to the store&lt;/li&gt;
    &lt;li&gt;Pick up dinner&lt;/li&gt;
    &lt;li&gt;Debug crash&lt;/li&gt;

    &lt;li&gt;Take a jog&lt;/li&gt;
  &lt;/ul&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>To toggle a style on table cells:</p>
<pre>
<code class="javascript">$("td").toggle(
  function () {
    $(this).addClass("selected");
  },
  function () {
    $(this).removeClass("selected");
  }
);</code>
</pre>
</div>
</div>
</li>
<li id="link-toggleClass-class">
<span class="fn"><a class="name" href="#link-toggleClass-class">toggleClass</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="A CSS class to toggle on the elements.">class</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Adds the specified class if it is not present, removes the specified class if it is present.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Toggle the class 'highlight' when a paragraph is clicked.</p>
<pre>
<code class="javascript">
    $("p").click(function () {
      $(this).toggleClass("highlight");
    });
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p class="blue"&gt;Click to toggle&lt;/p&gt;

  &lt;p class="blue highlight"&gt;highlight&lt;/p&gt;
  &lt;p class="blue"&gt;on these&lt;/p&gt;
  &lt;p class="blue"&gt;paragraphs&lt;/p&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-trigger-type data ">
<span class="fn"><a class="name" href="#link-trigger-type data ">trigger</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="An event type to trigger.">type </span>, <span class="arg-type tooltip" title="">Array</span> <span class="arg-name tooltip" title="Additional data to pass as arguments (after the event object) to the event handler.">data </span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Trigger a type of event on every matched element.<br>&lt;p&gt;This will also cause the default action of the browser with the same name (if one exists) to be executed. For example, passing 'submit' to the trigger() function will also cause the browser to submit the form. This default action can be prevented by returning false from one of the functions bound to the event.&lt;/p&gt;&lt;p&gt;You can also trigger custom events registered with bind.&lt;/p&gt;</div>
<div class="example">
<h3>Example:</h3>
<p>Clicks to button #2 also trigger a click for button #1.</p>
<pre>
<code class="javascript">

    $("button:first").click(function () {
      update($("span:first"));
    });
    $("button:last").click(function () {
      $("button:first").trigger('click');

      update($("span:last"));
    });

    function update(j) {
      var n = parseInt(j.text(), 0);
      j.text(n + 1);
    }
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;button&gt;Button #1&lt;/button&gt;

  &lt;button&gt;Button #2&lt;/button&gt;
  &lt;div&gt;&lt;span&gt;0&lt;/span&gt; button #1 clicks.&lt;/div&gt;
  &lt;div&gt;&lt;span&gt;0&lt;/span&gt; button #2 clicks.&lt;/div&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>To submit the first form without using the submit() function, try:</p>
<pre>
<code class="javascript">$("form:first").trigger("submit")</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>To pass arbitrary data to an event:</p>
<pre>
<code class="javascript">$("p").click( function (event, a, b) {
  // when a normal click fires, a and b are undefined
  // for a trigger like below a refers too "foo" and b refers to "bar"

} ).trigger("click", ["foo", "bar"]);</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>This would display a "Hello World!" alert box.</p>
<pre>
<code class="javascript">$("p").bind("myEvent", function (event, message1, message2) {
  alert(message1 + ' ' + message2);
});
$("p").trigger("myEvent", ["Hello","World!"]);</code>
</pre>
</div>
</div>
</li>
<li id="link-triggerHandler-type data ">
<span class="fn"><a class="name" href="#link-triggerHandler-type data ">triggerHandler</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="An event type to trigger.">type </span>, <span class="arg-type tooltip" title="">Array</span> <span class="arg-name tooltip" title="Additional data to pass as arguments (after the event object) to the event handler.">data </span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">This particular method triggers all bound event handlers on an element (for a specific event type) WITHOUT executing the browsers default actions.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>If you called .triggerHandler() on a focus event - the browsers default focus action would not be triggered, only the event handlers bound to the focus event.</p>
<pre>
<code class="javascript">

    $("#old").click(function(){
      $("input").trigger("focus");
    });
    $("#new").click(function(){
      $("input").triggerHandler("focus");
    });
    $("input").focus(function(){
      $("&lt;span&gt;Focused!&lt;/span&gt;").appendTo("body").fadeOut(1000);
    });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;button id="old"&gt;.trigger("focus")&lt;/button&gt;
  &lt;button id="new"&gt;.triggerHandler("focus")&lt;/button&gt;&lt;br/&gt;&lt;br/&gt;

  &lt;input type="text" value="To Be Focused"/&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-unbind-type data ">
<span class="fn"><a class="name" href="#link-unbind-type data ">unbind</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="An event type to unbind.">type </span>, <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="A function to unbind from the event on each of the set of matched elements.">data </span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">This does the opposite of bind, it removes bound events from each of the matched elements.<br>&lt;p&gt;Without any arguments, all bound events are removed.&lt;/p&gt;&lt;p&gt;You can also unbind custom events registered with bind.&lt;/p&gt;&lt;p&gt;If the type is provided, all bound events of that type are removed.&lt;/p&gt;&lt;p&gt;If the function that was passed to bind is provided as the second argument, only that specific event handler is removed.&lt;/p&gt;</div>
<div class="example">
<h3>Example:</h3>
<p>Can bind and unbind events to the colored button.</p>
<pre>
<code class="javascript">

    function aClick() {
      $("div").show().fadeOut("slow");
    }
    $("#bind").click(function () {
      // could use .bind('click', aClick) instead but for variety...
      $("#theone").click(aClick)
                  .text("Can Click!");
    });
    $("#unbind").click(function () {
      $("#theone").unbind('click', aClick)
                  .text("Does nothing...");
    });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;button id="theone"&gt;Does nothing...&lt;/button&gt;
  &lt;button id="bind"&gt;Bind Click&lt;/button&gt;
  &lt;button id="unbind"&gt;Unbind Click&lt;/button&gt;

  &lt;div style="display:none;"&gt;Click!&lt;/div&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>To unbind all events from all paragraphs, write:</p>
<pre>
<code class="javascript">$("p").unbind()</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>To unbind all click events from all paragraphs, write:</p>
<pre>
<code class="javascript">$("p").unbind( "click" )</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>To unbind just one previously bound handler, pass the function in as the second argument:</p>
<pre>
<code class="javascript">var foo = function () {
  // code to handle some kind of event
};

$("p").bind("click", foo); // ... now foo will be called when paragraphs are clicked ...

$("p").unbind("click", foo); // ... foo will no longer be called.</code>
</pre>
</div>
</div>
</li>
<li id="link-unload-fn">
<span class="fn"><a class="name" href="#link-unload-fn">unload</a>( <span class="arg-type tooltip" title="A reference to a Javascript function.">Function</span> <span class="arg-name tooltip" title="function to bind to the unload event on each of the matched elements.

<pre>function callback(eventObject) {
  this; // dom element
}
</pre>">fn</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Binds a function to the unload event of each matched element.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>To display an alert when a page is unloaded:</p>
<pre>
<code class="javascript">$(window).unload( function () { alert("Bye now!"); } );</code>
</pre>
</div>
</div>
</li>
<li id="link-val-">
<span class="fn"><a class="name" href="#link-val-">val</a>(  ) returns <span class="type"><span class="tooltip" title="">String, Array</span></span></span>
<div class="more">
<div class="desc">Get the content of the value attribute of the first matched element.<br>In jQuery 1.2, a value is now returned for all elements, including selects. For multiple selects an array of values is returned.<br>
<br>For older versions of jQuery use the [http://www.malsup.com/jquery/form/#fields fieldValue function of the Form Plugin].</div>
<div class="example">
<h3>Example:</h3>
<p>Get the single value from a single select and an array of values from a multiple select and display their values.</p>
<pre>
<code class="javascript">
    function displayVals() {
      var singleValues = $("#single").val();
      var multipleValues = $("#multiple").val() || [];
      $("p").html("&lt;b&gt;Single:&lt;/b&gt; " + 
                  singleValues +
                  " &lt;b&gt;Multiple:&lt;/b&gt; " + 
                  multipleValues.join(", "));
    }

    $("select").change(displayVals);
    displayVals();

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;&lt;/p&gt;
  &lt;select id="single"&gt;
    &lt;option&gt;Single&lt;/option&gt;
    &lt;option&gt;Single2&lt;/option&gt;

  &lt;/select&gt;
  &lt;select id="multiple" multiple="multiple"&gt;
    &lt;option selected="selected"&gt;Multiple&lt;/option&gt;
    &lt;option&gt;Multiple2&lt;/option&gt;

    &lt;option selected="selected"&gt;Multiple3&lt;/option&gt;
  &lt;/select&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Find the value of an input box.</p>
<pre>
<code class="javascript">
    $("input").keyup(function () {
      var value = $(this).val();
      $("p").text(value);
    }).keyup();
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;input type="text" value="some text"/&gt;
  &lt;p&gt;&lt;/p&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-val-val">
<span class="fn"><a class="name" href="#link-val-val">val</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="The value to set on the matched element.">val</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Set the value attribute of every matched element.<br>In jQuery 1.2, this is also able to set the value of select elements, but selecting the appropriate options.</div>
<div class="example">
<h3>Example:</h3>
<p>Set the value of an input box.</p>
<pre>
<code class="javascript">

    $("button").click(function () {
      var text = $(this).text();
      $("input").val(text);
    });
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;
    &lt;button&gt;Feed&lt;/button&gt;
    &lt;button&gt;the&lt;/button&gt;

    &lt;button&gt;Input&lt;/button&gt;
  &lt;/div&gt;
  &lt;input type="text" value="click a button" /&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-val-val">
<span class="fn"><a class="name" href="#link-val-val">val</a>( <span class="arg-type tooltip" title="An Array of strings.">Array&lt;String&gt;</span> <span class="arg-name tooltip" title="The set of values to check/select.">val</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Checks, or selects, all the radio buttons, checkboxes, and select options that match the set of values.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Get the single value from a single select and an array of values from a multiple select and display their values.</p>
<pre>
<code class="javascript">

    $("#single").val("Single2");
    $("#multiple").val(["Multiple2", "Multiple3"]);
    $("input").val(["check2", "radio1"]);

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;select id="single"&gt;
    &lt;option&gt;Single&lt;/option&gt;
    &lt;option&gt;Single2&lt;/option&gt;
  &lt;/select&gt;

  &lt;select id="multiple" multiple="multiple"&gt;
    &lt;option selected="selected"&gt;Multiple&lt;/option&gt;
    &lt;option&gt;Multiple2&lt;/option&gt;

    &lt;option selected="selected"&gt;Multiple3&lt;/option&gt;
  &lt;/select&gt;&lt;br/&gt;
  &lt;input type="checkbox" value="check1"/&gt; check1
  &lt;input type="checkbox" value="check2"/&gt; check2
  &lt;input type="radio" name="r" value="radio1"/&gt; radio1
  &lt;input type="radio" name="r" value="radio2"/&gt; radio2</code>
</pre>
</div>
</div>
</li>
<li id="link-visible-">
<span class="fn"><a class="name" href="#link-visible-">visible</a>(  ) returns <span class="type"><span class="tooltip" title="An Array of DOM Elements.">Array&lt;Element&gt;</span></span></span>
<div class="more">
<div class="desc">Matches all elements that are visible.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Make all visible divs turn yellow on click.</p>
<pre>
<code class="javascript">
    $("div:visible").click(function () {
      $(this).css("background", "yellow");
    });
    $("button").click(function () {
      $("div:hidden").show("fast");
    });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;button&gt;Show hidden to see they don't change&lt;/button&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div class="starthidden"&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;

  &lt;div&gt;&lt;/div&gt;
  &lt;div style="display:none;"&gt;&lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-width-">
<span class="fn"><a class="name" href="#link-width-">width</a>(  ) returns <span class="type"><span class="tooltip" title="">Integer</span></span></span>
<div class="more">
<div class="desc">Get the current computed, pixel, width of the first matched element.<br>In jQuery 1.2, this method is able to find the width of the window and document.</div>
<div class="example">
<h3>Example:</h3>
<p>Show various widths.  Note the values are from the iframe so might be smaller than you expected.  The yellow highlight shows the iframe body.</p>
<pre>
<code class="javascript">
    function showWidth(ele, w) {
      $("div").text("The width for the " + ele + 
                    " is " + w + "px.");
    }
    $("#getp").click(function () { 
      showWidth("paragraph", $("p").width()); 
    });
    $("#getd").click(function () { 
      showWidth("document", $(document).width()); 
    });
    $("#getw").click(function () { 
      showWidth("window", $(window).width()); 
    });

</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;button id="getp"&gt;Get Paragraph Width&lt;/button&gt;
  &lt;button id="getd"&gt;Get Document Width&lt;/button&gt;
  &lt;button id="getw"&gt;Get Window Width&lt;/button&gt;

  &lt;div&gt;&amp;nbsp;&lt;/div&gt;
  &lt;p&gt;
    Sample paragraph to test width
  &lt;/p&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-width-val">
<span class="fn"><a class="name" href="#link-width-val">width</a>( <span class="arg-type tooltip" title="">String, Number</span> <span class="arg-name tooltip" title="Set the CSS 'width' property to the specified value.">val</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Set the CSS width of every matched element.<br>If no explicit unit was specified (like 'em' or '%') then "px" is concatenated to the value.</div>
<div class="example">
<h3>Example:</h3>
<p>To set the width of each div on click to 30px plus a color change.</p>
<pre>
<code class="javascript">

    $("div").one('click', function () {
      $(this).width(30)
             .css({cursor:"auto", "background-color":"blue"});
    });
</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;

  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;
  &lt;div&gt;&lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-wrap-html">
<span class="fn"><a class="name" href="#link-wrap-html">wrap</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="A string of HTML that will be created on the fly and wrapped around the target.">html</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Wrap all matched elements with a structure of other elements.<br>This wrapping process is most useful for injecting additional structure into a document, without ruining the original semantic qualities of a document.<br>
<br>This works by going through the first element provided (which is generated, on the fly, from the provided HTML) and finds the deepest ancestor element within its structure -- it is that element that will enwrap everything else.<br>
<br>This does not work with elements that contain text. Any necessary text must be added after the wrapping is done.</div>
<div class="example">
<h3>Example:</h3>
<p>Wraps a newly created div around all paragraphs.</p>
<pre>
<code class="javascript">$("p").wrap("&lt;div class='wrap'&gt;&lt;/div&gt;");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;Test Paragraph.&lt;/p&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Wraps a newly created tree of objects around each span.</p>
<pre>
<code class="javascript">$("span").wrap("&lt;div&gt;&lt;div&gt;&lt;p&gt;&lt;em&gt;&lt;b&gt;&lt;/b&gt;&lt;/em&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;span&gt;Span Text&lt;/span&gt;
  &lt;span&gt;Another One&lt;/span&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-wrap-elem">
<span class="fn"><a class="name" href="#link-wrap-elem">wrap</a>( <span class="arg-type tooltip" title="The Javascript object representation of a DOM Element.">Element</span> <span class="arg-name tooltip" title="A DOM element that will be wrapped around the target.">elem</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Wrap all matched elements with a structure of other elements.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Wraps an element with id of "content" around all paragraphs.</p>
<pre>
<code class="javascript">$("p").wrap(document.getElementById('content'));</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;Test Paragraph.&lt;/p&gt;&lt;div id="content"&gt;&lt;/div&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Wraps a jQuery object (in this case a div) around all paragraphs.</p>
<pre>
<code class="javascript">$("p").wrap($("&lt;div&gt;"));</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;Test Paragraph.&lt;/p&gt;

  &lt;p&gt;Another Paragraph.&lt;/p&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-wrapAll-html">
<span class="fn"><a class="name" href="#link-wrapAll-html">wrapAll</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="A string of HTML that will be created on the fly and wrapped around the target.">html</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Wrap all the elements in the matched set into a single wrapper element.<br>This is different from &lt;a href='Manipulation/wrap'&gt;.wrap()&lt;/a&gt; where each element in the matched set would get wrapped with an element.<br>
<br>This wrapping process is most useful for injecting additional structure into a document, without ruining the original semantic qualities of a document.<br>
<br>This works by going through the first element provided (which is generated, on the fly, from the provided HTML) and finds the deepest ancestor element within its structure -- it is that element that will enwrap everything else.</div>
<div class="example">
<h3>Example:</h3>
<p>Wrap a new div around all of the paragraphs.</p>
<pre>
<code class="javascript">$("p").wrapAll("&lt;div&gt;&lt;/div&gt;");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;Hello&lt;/p&gt;
  &lt;p&gt;cruel&lt;/p&gt;
  &lt;p&gt;World&lt;/p&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Wraps a newly created tree of objects around the spans.  Notice anything in between the spans gets left out like the &lt;strong&gt; (red text) in this example.  Even the white space between spans is left out.  Click View Source to see the original html.</p>
<pre>
<code class="javascript">$("span").wrapAll("&lt;div&gt;&lt;div&gt;&lt;p&gt;&lt;em&gt;&lt;b&gt;&lt;/b&gt;&lt;/em&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;span&gt;Span Text&lt;/span&gt;
  &lt;strong&gt;What about me?&lt;/strong&gt;
  &lt;span&gt;Another One&lt;/span&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-wrapAll-elem">
<span class="fn"><a class="name" href="#link-wrapAll-elem">wrapAll</a>( <span class="arg-type tooltip" title="The Javascript object representation of a DOM Element.">Element</span> <span class="arg-name tooltip" title="A DOM element that will be wrapped around the target.">elem</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Wrap all the elements in the matched set into a single wrapper element.<br>This is different from &lt;a href='Manipulation/wrap'&gt;.wrap()&lt;/a&gt; where each element in the matched set would get wrapped with an element.</div>
<div class="example">
<h3>Example:</h3>
<p>Wrap a new div around all of the paragraphs.</p>
<pre>
<code class="javascript">$("p").wrapAll(document.createElement("div"));</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;Hello&lt;/p&gt;
  &lt;p&gt;cruel&lt;/p&gt;
  &lt;p&gt;World&lt;/p&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Wrap a jQuery object double depth div around all of the paragraphs.  Notice it doesn't move the object but just clones it to wrap around its target.</p>
<pre>
<code class="javascript">$("p").wrapAll($(".doublediv"));</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;Hello&lt;/p&gt;
  &lt;p&gt;cruel&lt;/p&gt;
  &lt;p&gt;World&lt;/p&gt;
  &lt;div class="doublediv"&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;</code>
</pre>
</div>
</div>
</li>
<li id="link-wrapInner-html">
<span class="fn"><a class="name" href="#link-wrapInner-html">wrapInner</a>( <span class="arg-type tooltip" title="A string of characters.">String</span> <span class="arg-name tooltip" title="A string of HTML that will be created on the fly and wrapped around the target.">html</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Wrap the inner child contents of each matched element (including text nodes) with an HTML structure.<br>This wrapping process is most useful for injecting additional structure into a document, without ruining the original semantic qualities of a document.<br>
<br>This works by going through the first element provided (which is generated, on the fly, from the provided HTML) and finds the deepest ancestor element within its structure -- it is that element that will enwrap everything else.</div>
<div class="example">
<h3>Example:</h3>
<p>Selects all paragraphs and wraps a bold tag around each of its contents.</p>
<pre>
<code class="javascript">$("p").wrapInner("&lt;b&gt;&lt;/b&gt;");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;Hello&lt;/p&gt;

  &lt;p&gt;cruel&lt;/p&gt;
  &lt;p&gt;World&lt;/p&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Wraps a newly created tree of objects around the inside of the body.</p>
<pre>
<code class="javascript">$("body").wrapInner("&lt;div&gt;&lt;div&gt;&lt;p&gt;&lt;em&gt;&lt;b&gt;&lt;/b&gt;&lt;/em&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;");</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">Plain old text, or is it?</code>
</pre>
</div>
</div>
</li>
<li id="link-wrapInner-elem">
<span class="fn"><a class="name" href="#link-wrapInner-elem">wrapInner</a>( <span class="arg-type tooltip" title="The Javascript object representation of a DOM Element.">Element</span> <span class="arg-name tooltip" title="A DOM element that will be wrapped around the target.">elem</span> ) returns <span class="type"><span class="tooltip" title="A jQuery object.">jQuery</span></span></span>
<div class="more">
<div class="desc">Wrap the inner child contents of each matched element (including text nodes) with a DOM element.<br>
</div>
<div class="example">
<h3>Example:</h3>
<p>Selects all paragraphs and wraps a bold tag around each of its contents.</p>
<pre>
<code class="javascript">$("p").wrapInner(document.createElement("b"));</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;Hello&lt;/p&gt;

  &lt;p&gt;cruel&lt;/p&gt;
  &lt;p&gt;World&lt;/p&gt;</code>
</pre>
</div>
<div class="example">
<h3>Example:</h3>
<p>Selects all paragraphs and wraps a jQuery object around each of its contents.</p>
<pre>
<code class="javascript">$("p").wrapInner($("&lt;span class='red'&gt;&lt;/span&gt;"));</code>
</pre>
<h4>HTML:</h4>
<pre>
<code class="html">&lt;p&gt;Hello&lt;/p&gt;
  &lt;p&gt;cruel&lt;/p&gt;
  &lt;p&gt;World&lt;/p&gt;</code>
</pre>
</div>
</div>
</li>
</ul>
</div>
</body>
</html>
